Merge pull request #6 from TanguyHerbron/master
Update the branch for new code coming
This commit is contained in:
commit
1c670d6e5d
46
.idea/assetWizardSettings.xml
generated
Normal file
46
.idea/assetWizardSettings.xml
generated
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="WizardSettings">
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorWizard">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorAssetStep">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="clipartAsset">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="values">
|
||||||
|
<map>
|
||||||
|
<entry key="url" value="jar:file:/C:/Program%20Files/Android/Android%20Studio/plugins/android/lib/android.jar!/images/material_design_icons/image/ic_panorama_fish_eye_black_24dp.xml" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
<option name="values">
|
||||||
|
<map>
|
||||||
|
<entry key="outputName" value="ic_panorama_fish_eye_24dp" />
|
||||||
|
<entry key="sourceFile" value="C:\Users\Guitoune" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@ -5,7 +5,7 @@
|
|||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="distributionType" value="LOCAL" />
|
<option name="distributionType" value="LOCAL" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-4.7" />
|
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-4.4" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
|
17
.idea/inspectionProfiles/Project_Default.xml
generated
17
.idea/inspectionProfiles/Project_Default.xml
generated
@ -1,17 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="HardCodedStringLiteral" enabled="true" level="WARNING" enabled_by_default="true">
|
|
||||||
<option name="ignoreForAssertStatements" value="true" />
|
|
||||||
<option name="ignoreForExceptionConstructors" value="true" />
|
|
||||||
<option name="ignoreForSpecifiedExceptionConstructors" value="" />
|
|
||||||
<option name="ignoreForJUnitAsserts" value="true" />
|
|
||||||
<option name="ignoreForClassReferences" value="true" />
|
|
||||||
<option name="ignoreForPropertyKeyReferences" value="true" />
|
|
||||||
<option name="ignoreForNonAlpha" value="true" />
|
|
||||||
<option name="ignoreAssignedToConstants" value="false" />
|
|
||||||
<option name="ignoreToString" value="false" />
|
|
||||||
<option name="nonNlsCommentPattern" value="NON-NLS" />
|
|
||||||
</inspection_tool>
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
12
.idea/misc.xml
generated
12
.idea/misc.xml
generated
@ -1,20 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="EntryPointsManager">
|
|
||||||
<list size="1">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.greenrobot.eventbus.Subscribe" />
|
|
||||||
</list>
|
|
||||||
</component>
|
|
||||||
<component name="NullableNotNullManager">
|
<component name="NullableNotNullManager">
|
||||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||||
<option name="myNullables">
|
<option name="myNullables">
|
||||||
<value>
|
<value>
|
||||||
<list size="4">
|
<list size="5">
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||||
|
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||||
</list>
|
</list>
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
|
12
.idea/statistic.xml
generated
12
.idea/statistic.xml
generated
@ -1,20 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="Statistic">
|
<component name="Statistic">
|
||||||
<option name="fileTypes" value="class;svn-base;svn-work;Extra;gif;png;jpg;jpeg;bmp;tga;tiff;ear;war;zip;jar;iml;iws;ipr;bz2;gz;gitignore;gradle;md;pro;properties;" />
|
<option name="fileTypes" value="class;svn-base;svn-work;Extra;gif;png;jpg;jpeg;bmp;tga;tiff;ear;war;zip;jar;iml;iws;ipr;bz2;gz;ap;apk;bin;dex;flat;gitignore;gson;json;md;pro;store;ttf;txt;ap_;" />
|
||||||
<option name="excludedDirectories">
|
<option name="excludedDirectories">
|
||||||
<list>
|
<list>
|
||||||
<option value="$PROJECT_DIR$/build" />
|
<option value="$PROJECT_DIR$/.idea" />
|
||||||
|
<option value="$PROJECT_DIR$/.gradle" />
|
||||||
<option value="$PROJECT_DIR$/export" />
|
<option value="$PROJECT_DIR$/export" />
|
||||||
<option value="$PROJECT_DIR$/gource" />
|
<option value="$PROJECT_DIR$/gource" />
|
||||||
<option value="$PROJECT_DIR$/gradle" />
|
<option value="$PROJECT_DIR$/gradle" />
|
||||||
<option value="$PROJECT_DIR$/libs" />
|
<option value="$PROJECT_DIR$/libs" />
|
||||||
<option value="$PROJECT_DIR$/.idea" />
|
|
||||||
<option value="$PROJECT_DIR$/.gradle" />
|
|
||||||
<option value="$PROJECT_DIR$/app/build" />
|
|
||||||
<option value="$PROJECT_DIR$/app/release" />
|
|
||||||
<option value="$PROJECT_DIR$/app/src/androidTest" />
|
|
||||||
<option value="$PROJECT_DIR$/app/src/test" />
|
<option value="$PROJECT_DIR$/app/src/test" />
|
||||||
|
<option value="$PROJECT_DIR$/app/src/androidTest" />
|
||||||
|
<option value="$PROJECT_DIR$/app/build" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -6,16 +6,22 @@ android {
|
|||||||
applicationId "com.herbron.moodl"
|
applicationId "com.herbron.moodl"
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 5
|
versionCode 6
|
||||||
versionName "0.0.5"
|
versionName "0.0.6"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
vectorDrawables.useSupportLibrary = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dataBinding {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
lintOptions {
|
lintOptions {
|
||||||
disable 'MissingTranslation'
|
//disable 'MissingTranslation'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,7 +38,7 @@ dependencies {
|
|||||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
implementation 'com.android.support:cardview-v7:27.1.1'
|
||||||
implementation 'com.mcxiaoke.volley:library:1.0.19'
|
implementation 'com.mcxiaoke.volley:library:1.0.19'
|
||||||
implementation 'com.diogobernardino:williamchart:2.5.0'
|
implementation 'com.diogobernardino:williamchart:2.5.0'
|
||||||
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
|
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||||||
implementation 'com.android.support:support-v4:27.1.1'
|
implementation 'com.android.support:support-v4:27.1.1'
|
||||||
implementation 'com.android.support:palette-v7:27.1.1'
|
implementation 'com.android.support:palette-v7:27.1.1'
|
||||||
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
|
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
|
||||||
@ -47,9 +53,13 @@ dependencies {
|
|||||||
implementation 'com.mattprecious.swirl:swirl:1.1.0'
|
implementation 'com.mattprecious.swirl:swirl:1.1.0'
|
||||||
implementation 'com.wdullaer:materialdatetimepicker:3.5.2'
|
implementation 'com.wdullaer:materialdatetimepicker:3.5.2'
|
||||||
implementation 'com.jmedeisis:draglinearlayout:1.1.0'
|
implementation 'com.jmedeisis:draglinearlayout:1.1.0'
|
||||||
|
implementation 'com.applandeo:material-file-picker:1.0.0'
|
||||||
|
implementation 'com.daasuu:EasingInterpolator:1.0.0'
|
||||||
|
implementation 'com.android.support:support-vector-drawable:27.1.1'
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||||
|
|
||||||
implementation files('../libs/binance-api.jar')
|
implementation files('../libs/binance-api.jar')
|
||||||
|
implementation files('../libs/commons-codec-1.11.jar');
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.herbron.moodl">
|
package="com.herbron.moodl">
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.fingerprint"
|
<uses-feature
|
||||||
android:required="false"/>
|
android:name="android.hardware.fingerprint"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@ -16,11 +18,11 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name="com.herbron.moodl.Activities.HomeActivity"
|
android:name=".Activities.HomeActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
android:launchMode="singleTop">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@ -28,30 +30,31 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.herbron.moodl.Activities.SettingsActivity"
|
android:name=".Activities.SettingsActivity"
|
||||||
android:label="@string/title_activity_settings"
|
android:label="@string/title_activity_settings"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.herbron.moodl.Activities.CurrencySelectionActivity"
|
android:name=".Activities.CurrencySelectionActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.herbron.moodl.Activities.HomeActivity"/>
|
android:value="com.herbron.moodl.Activities.HomeActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.herbron.moodl.Activities.RecordTransactionActivity"
|
android:name=".Activities.RecordTransactionActivity"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/RecordTransactionTheme">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.herbron.moodl.Activities.HomeActivity"/>
|
android:value="com.herbron.moodl.Activities.HomeActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.herbron.moodl.Activities.CurrencyDetailsActivity"
|
android:name=".Activities.CurrencyDetailsActivity"
|
||||||
android:label="@string/title_activity_currency_details"
|
android:label="@string/title_activity_currency_details"
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.herbron.moodl.Activities.HomeActivity"/>
|
android:value="com.herbron.moodl.Activities.HomeActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear
|
|||||||
|
|
||||||
currencyDetailsList = CurrencyDetailsList.getInstance(this);
|
currencyDetailsList = CurrencyDetailsList.getInstance(this);
|
||||||
|
|
||||||
setTitle("Select a coin");
|
setTitle(getString(R.string.select_coin));
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
isWatchList = intent.getBooleanExtra("isWatchList", false);
|
isWatchList = intent.getBooleanExtra("isWatchList", false);
|
||||||
@ -103,7 +103,7 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Toast.makeText(getApplicationContext(), "Currency already in watchlist.", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), getString(R.string.already_watchlisr), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -7,12 +7,16 @@ import android.os.Bundle;
|
|||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.github.mikephil.charting.charts.BarChart;
|
import com.github.mikephil.charting.charts.BarChart;
|
||||||
@ -47,7 +51,7 @@ import static com.herbron.moodl.MoodlBox.numberConformer;
|
|||||||
* Created by Tiji on 13/05/2018.
|
* Created by Tiji on 13/05/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Home extends Fragment {
|
public class Charts extends Fragment {
|
||||||
|
|
||||||
private final static int HOUR = 0;
|
private final static int HOUR = 0;
|
||||||
private final static int DAY = 1;
|
private final static int DAY = 1;
|
||||||
@ -72,7 +76,7 @@ public class Home extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
view = inflater.inflate(R.layout.fragment_home_detailsactivity, container, false);
|
view = inflater.inflate(R.layout.fragment_charts_detailsactivity, container, false);
|
||||||
|
|
||||||
currency = getActivity().getIntent().getParcelableExtra("currency");
|
currency = getActivity().getIntent().getParcelableExtra("currency");
|
||||||
|
|
||||||
@ -111,15 +115,168 @@ public class Home extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
initializeButtons();
|
|
||||||
initializeLineChart(lineChart);
|
initializeLineChart(lineChart);
|
||||||
initializeCandleStickChart(candleStickChart);
|
initializeCandleStickChart(candleStickChart);
|
||||||
|
|
||||||
updateChartTab(DAY, 1);
|
initializeSpinners();
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initializeSpinners()
|
||||||
|
{
|
||||||
|
Spinner spinner = view.findViewById(R.id.timeIntervalSinner);
|
||||||
|
|
||||||
|
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getContext(),
|
||||||
|
R.array.time_interval_string_array, android.R.layout.simple_spinner_item);
|
||||||
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
spinner.setAdapter(adapter);
|
||||||
|
|
||||||
|
spinner.setSelection(2);
|
||||||
|
|
||||||
|
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
|
updateCharts(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCharts(int index)
|
||||||
|
{
|
||||||
|
view.findViewById(R.id.chartPriceView).setVisibility(View.GONE);
|
||||||
|
view.findViewById(R.id.chartCandleStickView).setVisibility(View.GONE);
|
||||||
|
view.findViewById(R.id.chartVolumeView).setVisibility(View.GONE);
|
||||||
|
view.findViewById(R.id.progressLayoutChart).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
currency.updateHistoryMinutes(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.HOUR, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
currency.updateHistoryMinutes(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.HOUR, 3);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
currency.updateHistoryMinutes(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.DAY, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
currency.updateHistoryHours(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.DAY, 3);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
currency.updateHistoryHours(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.WEEK, 11);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
currency.updateHistoryHours(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.MONTH, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
currency.updateHistoryDays(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.MONTH, 3);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
currency.updateHistoryDays(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.MONTH, 6);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
currency.updateHistoryDays(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateChartTab(Charts.YEAR, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initializeCandleStickChart(CandleStickChart candleStickChart)
|
private void initializeCandleStickChart(CandleStickChart candleStickChart)
|
||||||
{
|
{
|
||||||
candleStickChart.setDrawGridBackground(false);
|
candleStickChart.setDrawGridBackground(false);
|
||||||
@ -150,182 +307,6 @@ public class Home extends Fragment {
|
|||||||
lineChart.setViewPortOffsets(0, 0, 0, 0);
|
lineChart.setViewPortOffsets(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeButtons()
|
|
||||||
{
|
|
||||||
LinearLayout buttonLayout = view.findViewById(R.id.layoutChartButtons);
|
|
||||||
|
|
||||||
for(int i = 0; i < buttonLayout.getChildCount(); i++)
|
|
||||||
{
|
|
||||||
final Button button = (Button) buttonLayout.getChildAt(i);
|
|
||||||
button.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
buttonEvent(v);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonEvent(View v)
|
|
||||||
{
|
|
||||||
v.setEnabled(false);
|
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
{
|
|
||||||
v.setElevation(MoodlBox.convertDpToPx(8, getResources()));
|
|
||||||
}
|
|
||||||
|
|
||||||
LinearLayout buttonLayout = (LinearLayout) v.getParent();
|
|
||||||
|
|
||||||
for(int i = 0; i < buttonLayout.getChildCount(); i++)
|
|
||||||
{
|
|
||||||
Button button = (Button) buttonLayout.getChildAt(i);
|
|
||||||
|
|
||||||
if(button != v)
|
|
||||||
{
|
|
||||||
button.setEnabled(true);
|
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
{
|
|
||||||
button.setElevation(MoodlBox.convertDpToPx(2, getResources()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateCharts((Button) v);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateCharts(Button button)
|
|
||||||
{
|
|
||||||
view.findViewById(R.id.chartPriceView).setVisibility(View.GONE);
|
|
||||||
view.findViewById(R.id.chartCandleStickView).setVisibility(View.GONE);
|
|
||||||
view.findViewById(R.id.chartVolumeView).setVisibility(View.GONE);
|
|
||||||
view.findViewById(R.id.progressLayoutChart).setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
String interval = button.getText().toString().substring(button.getText().toString().length()-2);
|
|
||||||
|
|
||||||
switch (interval)
|
|
||||||
{
|
|
||||||
case "1h":
|
|
||||||
currency.updateHistoryMinutes(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.HOUR, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "3h":
|
|
||||||
currency.updateHistoryMinutes(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.HOUR, 3);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "1d":
|
|
||||||
currency.updateHistoryMinutes(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.DAY, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "3d":
|
|
||||||
currency.updateHistoryHours(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.DAY, 3);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "1w":
|
|
||||||
currency.updateHistoryHours(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.WEEK, 11);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "1M":
|
|
||||||
currency.updateHistoryHours(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.MONTH, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "3M":
|
|
||||||
currency.updateHistoryDays(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.MONTH, 3);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "6M":
|
|
||||||
currency.updateHistoryDays(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.MONTH, 6);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "1y":
|
|
||||||
currency.updateHistoryDays(getContext(), preferencesManager.getDefaultCurrency(), new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateChartTab(Home.YEAR, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateChartTab(int timeUnit, int amount)
|
private void updateChartTab(int timeUnit, int amount)
|
||||||
{
|
{
|
||||||
updateChartsData(timeUnit, amount);
|
updateChartsData(timeUnit, amount);
|
@ -120,7 +120,7 @@ public class Informations extends Fragment {
|
|||||||
((TextView) view.findViewById(R.id.txtViewDescription))
|
((TextView) view.findViewById(R.id.txtViewDescription))
|
||||||
.setMovementMethod(LinkMovementMethod.getInstance());
|
.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
((TextView) view.findViewById(R.id.txtViewPercentageCoinEmited))
|
((TextView) view.findViewById(R.id.txtViewPercentageCoinEmited))
|
||||||
.setText("Percentage of coin emited : " + numberConformer(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100) + "%");
|
.setText(PlaceholderManager.getEmitedPercentageString(numberConformer(currency.getMinedCoinSupply() / currency.getMaxCoinSupply() * 100), getContext()));
|
||||||
|
|
||||||
if(currency.getMarketCapitalization() != 0)
|
if(currency.getMarketCapitalization() != 0)
|
||||||
{
|
{
|
||||||
@ -139,7 +139,7 @@ public class Informations extends Fragment {
|
|||||||
if(currency.getMaxCoinSupply() == 0)
|
if(currency.getMaxCoinSupply() == 0)
|
||||||
{
|
{
|
||||||
((TextView) view.findViewById(R.id.txtViewTotalSupply))
|
((TextView) view.findViewById(R.id.txtViewTotalSupply))
|
||||||
.setText(PlaceholderManager.getSymbolString("Infinity", getActivity()));
|
.setText(PlaceholderManager.getSymbolString(getString(R.string.infinity), getActivity()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
package com.herbron.moodl.Activities;
|
package com.herbron.moodl.Activities;
|
||||||
|
|
||||||
|
import android.annotation.TargetApi;
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
@ -27,6 +32,7 @@ import com.herbron.moodl.Activities.HomeActivityFragments.Summary;
|
|||||||
import com.herbron.moodl.Activities.HomeActivityFragments.Watchlist;
|
import com.herbron.moodl.Activities.HomeActivityFragments.Watchlist;
|
||||||
import com.herbron.moodl.BalanceSwitchManagerInterface;
|
import com.herbron.moodl.BalanceSwitchManagerInterface;
|
||||||
import com.herbron.moodl.BalanceUpdateInterface;
|
import com.herbron.moodl.BalanceUpdateInterface;
|
||||||
|
import com.herbron.moodl.DataManagers.DatabaseManager;
|
||||||
import com.herbron.moodl.DataManagers.PreferencesManager;
|
import com.herbron.moodl.DataManagers.PreferencesManager;
|
||||||
import com.herbron.moodl.PlaceholderManager;
|
import com.herbron.moodl.PlaceholderManager;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
@ -57,8 +63,9 @@ public class HomeActivity extends AppCompatActivity implements BalanceUpdateInte
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
setStatusBarGradiant(this);
|
||||||
|
|
||||||
/**Interface setup**/
|
/**Interface setup**/
|
||||||
Window w = getWindow();
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_currency_summary);
|
setContentView(R.layout.activity_currency_summary);
|
||||||
|
|
||||||
@ -98,6 +105,8 @@ public class HomeActivity extends AppCompatActivity implements BalanceUpdateInte
|
|||||||
break;
|
break;
|
||||||
case R.id.navigation_settings:
|
case R.id.navigation_settings:
|
||||||
Intent settingIntent = new Intent(getApplicationContext(), SettingsActivity.class);
|
Intent settingIntent = new Intent(getApplicationContext(), SettingsActivity.class);
|
||||||
|
settingIntent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.MainPreferenceFragment.class.getName() );
|
||||||
|
settingIntent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true );
|
||||||
startActivity(settingIntent);
|
startActivity(settingIntent);
|
||||||
item.setChecked(false);
|
item.setChecked(false);
|
||||||
break;
|
break;
|
||||||
@ -112,6 +121,18 @@ public class HomeActivity extends AppCompatActivity implements BalanceUpdateInte
|
|||||||
setupBalanceSwitch();
|
setupBalanceSwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
public static void setStatusBarGradiant(Activity activity) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
Window window = activity.getWindow();
|
||||||
|
Drawable background = activity.getResources().getDrawable(R.drawable.gradient_background);
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||||
|
window.setStatusBarColor(activity.getResources().getColor(android.R.color.transparent));
|
||||||
|
window.setNavigationBarColor(activity.getResources().getColor(android.R.color.transparent));
|
||||||
|
window.setBackgroundDrawable(background);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
drawerLayout.openDrawer(GravityCompat.START);
|
drawerLayout.openDrawer(GravityCompat.START);
|
||||||
@ -126,6 +147,10 @@ public class HomeActivity extends AppCompatActivity implements BalanceUpdateInte
|
|||||||
{
|
{
|
||||||
Switch balanceSwitch = findViewById(R.id.switchHideBalance);
|
Switch balanceSwitch = findViewById(R.id.switchHideBalance);
|
||||||
|
|
||||||
|
PreferencesManager preferencesManager = new PreferencesManager(getBaseContext());
|
||||||
|
|
||||||
|
balanceSwitch.setChecked(preferencesManager.isBalanceHidden());
|
||||||
|
|
||||||
balanceSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
balanceSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||||
@ -158,6 +183,11 @@ public class HomeActivity extends AppCompatActivity implements BalanceUpdateInte
|
|||||||
currentFragment = fragment;
|
currentFragment = fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Fragment getHoldingsFragment()
|
||||||
|
{
|
||||||
|
return holdingsFragment;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
@ -42,6 +42,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.herbron.moodl.MoodlBox.getColor;
|
||||||
import static java.lang.Math.abs;
|
import static java.lang.Math.abs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -235,10 +236,10 @@ public class MarketCapitalization extends Fragment {
|
|||||||
colors.add(topCurrencies.get(i).getChartColor());
|
colors.add(topCurrencies.get(i).getChartColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.add(new PieEntry(100-topCurrenciesDominance, "Others", "others"));
|
entries.add(new PieEntry(100-topCurrenciesDominance, getString(R.string.others), "others"));
|
||||||
colors.add(-12369084);
|
colors.add(-12369084);
|
||||||
|
|
||||||
PieDataSet set = new PieDataSet(entries, "Market Cap Dominance");
|
PieDataSet set = new PieDataSet(entries, getString(R.string.market_dominance));
|
||||||
set.setColors(colors);
|
set.setColors(colors);
|
||||||
set.setSliceSpace(1);
|
set.setSliceSpace(1);
|
||||||
set.setDrawValues(false);
|
set.setDrawValues(false);
|
||||||
@ -282,7 +283,7 @@ public class MarketCapitalization extends Fragment {
|
|||||||
Palette.Builder builder = Palette.from(bitmapIcon);
|
Palette.Builder builder = Palette.from(bitmapIcon);
|
||||||
|
|
||||||
marketCapManager.getTopCurrencies().get(index).setIcon(bitmapIcon);
|
marketCapManager.getTopCurrencies().get(index).setIcon(bitmapIcon);
|
||||||
marketCapManager.getTopCurrencies().get(index).setChartColor(builder.generate().getDominantColor(0));
|
marketCapManager.getTopCurrencies().get(index).setChartColor(builder.generate().getDominantColor(getColor(R.color.default_color, getContext())));
|
||||||
|
|
||||||
countIcons();
|
countIcons();
|
||||||
}
|
}
|
||||||
@ -309,7 +310,7 @@ public class MarketCapitalization extends Fragment {
|
|||||||
pieChart.setTouchEnabled(true);
|
pieChart.setTouchEnabled(true);
|
||||||
pieChart.setEntryLabelColor(Color.WHITE);
|
pieChart.setEntryLabelColor(Color.WHITE);
|
||||||
|
|
||||||
updateDetails(marketCapManager.getMarketCap(), marketCapManager.getDayVolume(), "Global", 0);
|
updateDetails(marketCapManager.getMarketCap(), marketCapManager.getDayVolume(), getString(R.string.global), 0);
|
||||||
((TextView) view.findViewById(R.id.textViewActiveCrypto))
|
((TextView) view.findViewById(R.id.textViewActiveCrypto))
|
||||||
.setText(marketCapManager.getActive_crypto());
|
.setText(marketCapManager.getActive_crypto());
|
||||||
((TextView) view.findViewById(R.id.textViewActiveMarkets))
|
((TextView) view.findViewById(R.id.textViewActiveMarkets))
|
||||||
@ -373,7 +374,7 @@ public class MarketCapitalization extends Fragment {
|
|||||||
view.findViewById(R.id.currencyIcon).setVisibility(View.GONE);
|
view.findViewById(R.id.currencyIcon).setVisibility(View.GONE);
|
||||||
view.findViewById(R.id.layoutPercentageDominance).setVisibility(View.VISIBLE);
|
view.findViewById(R.id.layoutPercentageDominance).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
updateDetails(othersMarketCap, othersVolume, "Other coins", h.getY());
|
updateDetails(othersMarketCap, othersVolume, getString(R.string.other_coins), h.getY());
|
||||||
|
|
||||||
pieChart.setDrawCenterText(true);
|
pieChart.setDrawCenterText(true);
|
||||||
}
|
}
|
||||||
@ -389,7 +390,7 @@ public class MarketCapitalization extends Fragment {
|
|||||||
view.findViewById(R.id.layoutActiveCrypto).setVisibility(View.VISIBLE);
|
view.findViewById(R.id.layoutActiveCrypto).setVisibility(View.VISIBLE);
|
||||||
view.findViewById(R.id.layoutActiveMarkets).setVisibility(View.VISIBLE);
|
view.findViewById(R.id.layoutActiveMarkets).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
updateDetails(marketCapManager.getMarketCap(), marketCapManager.getDayVolume(), "Global", 0);
|
updateDetails(marketCapManager.getMarketCap(), marketCapManager.getDayVolume(), getString(R.string.global), 0);
|
||||||
|
|
||||||
pieChart.setDrawCenterText(true);
|
pieChart.setDrawCenterText(true);
|
||||||
}
|
}
|
||||||
@ -415,7 +416,7 @@ public class MarketCapitalization extends Fragment {
|
|||||||
|
|
||||||
private SpannableString generateCenterSpannableText() {
|
private SpannableString generateCenterSpannableText() {
|
||||||
|
|
||||||
SpannableString spannableString = new SpannableString("Market Capitalization Dominance");
|
SpannableString spannableString = new SpannableString(getString(R.string.market_dominance));
|
||||||
return spannableString;
|
return spannableString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ package com.herbron.moodl.Activities.HomeActivityFragments;
|
|||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -27,6 +29,8 @@ import com.herbron.moodl.R;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.herbron.moodl.MoodlBox.getDrawable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Administrator on 27/05/2018.
|
* Created by Administrator on 27/05/2018.
|
||||||
*/
|
*/
|
||||||
@ -53,6 +57,8 @@ public class Overview extends Fragment {
|
|||||||
currencyTickerList = CurrencyTickerList.getInstance(getContext());
|
currencyTickerList = CurrencyTickerList.getInstance(getContext());
|
||||||
currencyDetailsList = CurrencyDetailsList.getInstance(getContext());
|
currencyDetailsList = CurrencyDetailsList.getInstance(getContext());
|
||||||
|
|
||||||
|
fragmentView.findViewById(R.id.toolbar).bringToFront();
|
||||||
|
|
||||||
preferenceManager = new PreferencesManager(getContext());
|
preferenceManager = new PreferencesManager(getContext());
|
||||||
|
|
||||||
listLayout = fragmentView.findViewById(R.id.linearLayoutOverview);
|
listLayout = fragmentView.findViewById(R.id.linearLayoutOverview);
|
||||||
@ -185,7 +191,14 @@ public class Overview extends Fragment {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_moodl);
|
Drawable drawable = getDrawable(R.drawable.ic_panorama_fish_eye_24dp, getContext());
|
||||||
|
|
||||||
|
Bitmap icon = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
|
||||||
|
Canvas canvas = new Canvas(icon);
|
||||||
|
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||||
|
drawable.draw(canvas);
|
||||||
|
|
||||||
icon = Bitmap.createScaledBitmap(icon, 50, 50, false);
|
icon = Bitmap.createScaledBitmap(icon, 50, 50, false);
|
||||||
|
|
||||||
currency.setIcon(icon);
|
currency.setIcon(icon);
|
||||||
|
@ -1,17 +1,25 @@
|
|||||||
package com.herbron.moodl.Activities.HomeActivityFragments;
|
package com.herbron.moodl.Activities.HomeActivityFragments;
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator;
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.CollapsingToolbarLayout;
|
import android.support.design.widget.CollapsingToolbarLayout;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
@ -23,25 +31,34 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.daasuu.ei.Ease;
|
||||||
|
import com.daasuu.ei.EasingInterpolator;
|
||||||
import com.herbron.moodl.Activities.CurrencySelectionActivity;
|
import com.herbron.moodl.Activities.CurrencySelectionActivity;
|
||||||
import com.herbron.moodl.Activities.HomeActivity;
|
import com.herbron.moodl.Activities.HomeActivity;
|
||||||
import com.herbron.moodl.BalanceUpdateInterface;
|
import com.herbron.moodl.BalanceUpdateInterface;
|
||||||
|
import com.herbron.moodl.DataManagers.BalanceManager;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyCardview;
|
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyCardview;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyTickerList;
|
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyTickerList;
|
||||||
import com.herbron.moodl.DataManagers.PreferencesManager;
|
import com.herbron.moodl.DataManagers.PreferencesManager;
|
||||||
import com.herbron.moodl.BalanceSwitchManagerInterface;
|
import com.herbron.moodl.BalanceSwitchManagerInterface;
|
||||||
|
import com.herbron.moodl.DataNotifierInterface;
|
||||||
import com.herbron.moodl.MoodlBox;
|
import com.herbron.moodl.MoodlBox;
|
||||||
import com.herbron.moodl.PlaceholderManager;
|
import com.herbron.moodl.PlaceholderManager;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import static com.herbron.moodl.MoodlBox.getColor;
|
||||||
|
import static com.herbron.moodl.MoodlBox.getDrawable;
|
||||||
import static com.herbron.moodl.MoodlBox.numberConformer;
|
import static com.herbron.moodl.MoodlBox.numberConformer;
|
||||||
import static java.lang.Math.abs;
|
import static java.lang.Math.abs;
|
||||||
|
|
||||||
@ -49,11 +66,11 @@ import static java.lang.Math.abs;
|
|||||||
* Created by Tiji on 13/04/2018.
|
* Created by Tiji on 13/04/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
public class Summary extends Fragment implements BalanceSwitchManagerInterface, DataNotifierInterface {
|
||||||
|
|
||||||
private LinearLayout currencyLayout;
|
private LinearLayout currencyLayout;
|
||||||
private PreferencesManager preferencesManager;
|
private PreferencesManager preferencesManager;
|
||||||
private com.herbron.moodl.DataManagers.BalanceManager balanceManager;
|
private BalanceManager balanceManager;
|
||||||
private SwipeRefreshLayout refreshLayout;
|
private SwipeRefreshLayout refreshLayout;
|
||||||
private Dialog loadingDialog;
|
private Dialog loadingDialog;
|
||||||
private String defaultCurrency;
|
private String defaultCurrency;
|
||||||
@ -83,7 +100,7 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
View fragmentView = inflater.inflate(R.layout.fragment_summary_homeactivity, container, false);
|
View fragmentView = inflater.inflate(R.layout.fragment_summary_homeactivity, container, false);
|
||||||
|
|
||||||
preferencesManager = new PreferencesManager(getActivity());
|
preferencesManager = new PreferencesManager(getActivity());
|
||||||
balanceManager = new com.herbron.moodl.DataManagers.BalanceManager(getActivity());
|
balanceManager = new BalanceManager(getContext());
|
||||||
currencyTickerList = CurrencyTickerList.getInstance(getActivity());
|
currencyTickerList = CurrencyTickerList.getInstance(getActivity());
|
||||||
|
|
||||||
currencyLayout = fragmentView.findViewById(R.id.currencyListLayout);
|
currencyLayout = fragmentView.findViewById(R.id.currencyListLayout);
|
||||||
@ -234,28 +251,48 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
|
|
||||||
private void generateSplashScreen()
|
private void generateSplashScreen()
|
||||||
{
|
{
|
||||||
LinearLayout loadingLayout = new LinearLayout(getActivity());
|
|
||||||
|
|
||||||
loadingLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
||||||
loadingLayout.setGravity(Gravity.CENTER);
|
|
||||||
loadingLayout.setOrientation(LinearLayout.VERTICAL);
|
|
||||||
|
|
||||||
loadingDialog = new Dialog(getActivity(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
loadingDialog = new Dialog(getActivity(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
||||||
|
|
||||||
TextView txtView = new TextView(getActivity());
|
Random random = new Random();
|
||||||
txtView.setText("Loading data...");
|
|
||||||
txtView.setTextSize(20);
|
|
||||||
txtView.setGravity(Gravity.CENTER);
|
|
||||||
txtView.setTextColor(this.getResources().getColor(R.color.cardview_light_background));
|
|
||||||
|
|
||||||
ProgressBar progressBar = new ProgressBar(getActivity());
|
LinearLayout splashLayout = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.splash_screen, null, true);
|
||||||
progressBar.setIndeterminate(true);
|
LinearLayout animatedLayout = splashLayout.findViewById(R.id.animatedViewsLayout);
|
||||||
|
|
||||||
loadingLayout.setBackgroundColor(getActivity().getResources().getColor(R.color.colorPrimaryDark));
|
File cacheDir = new File(getContext().getCacheDir().getAbsolutePath());
|
||||||
loadingLayout.addView(txtView);
|
File[] cacheFiles = cacheDir.listFiles();
|
||||||
loadingLayout.addView(progressBar);
|
|
||||||
|
|
||||||
loadingDialog.setContentView(loadingLayout);
|
for(int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
File cachedIcon = null;
|
||||||
|
|
||||||
|
while(cachedIcon == null || cachedIcon.isDirectory())
|
||||||
|
{
|
||||||
|
cachedIcon = cacheFiles[random.nextInt(cacheFiles.length)];
|
||||||
|
}
|
||||||
|
|
||||||
|
Bitmap icon = BitmapFactory.decodeFile(cachedIcon.getAbsolutePath());
|
||||||
|
|
||||||
|
Bitmap result = Bitmap.createBitmap(150, 150, icon.getConfig());
|
||||||
|
|
||||||
|
Paint paint = new Paint();
|
||||||
|
paint.setStyle(Paint.Style.FILL);
|
||||||
|
paint.setColor(ContextCompat.getColor(getContext(), R.color.white));
|
||||||
|
|
||||||
|
Canvas canvas = new Canvas(result);
|
||||||
|
canvas.drawCircle(result.getHeight()/2, result.getWidth()/2, 75, paint);
|
||||||
|
canvas.drawBitmap(Bitmap.createScaledBitmap(icon, 100, 100, false), result.getHeight()/2 - 50, result.getWidth()/2 - 50, null);
|
||||||
|
|
||||||
|
((ImageView) animatedLayout.getChildAt(i)).setImageBitmap(result);
|
||||||
|
|
||||||
|
ObjectAnimator animator = ObjectAnimator.ofFloat(animatedLayout.getChildAt(i), "translationY", 0, -100, 0);
|
||||||
|
animator.setInterpolator(new EasingInterpolator(Ease.CIRC_IN_OUT));
|
||||||
|
animator.setStartDelay(i*200);
|
||||||
|
animator.setDuration(1500);
|
||||||
|
animator.setRepeatCount(ValueAnimator.INFINITE);
|
||||||
|
animator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadingDialog.setContentView(splashLayout);
|
||||||
loadingDialog.show();
|
loadingDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,14 +341,14 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
|
|
||||||
private void showErrorSnackbar()
|
private void showErrorSnackbar()
|
||||||
{
|
{
|
||||||
/*Snackbar.make(getActivity().findViewById(R.id.snackbar_placer), "Error while updating data", Snackbar.LENGTH_LONG)
|
Snackbar.make(getActivity().findViewById(R.id.content_frame), getString(R.string.error_update_data), Snackbar.LENGTH_LONG)
|
||||||
.setAction("Update", new View.OnClickListener() {
|
.setAction(getString(R.string.update), new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.show();*/
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetCounters()
|
private void resetCounters()
|
||||||
@ -439,7 +476,7 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
updateBalanceDisplayedTitle(totalValue);
|
updateBalanceDisplayedTitle(totalFluctuationPercentage);
|
||||||
balanceUpdateInterface.onBalanceUpdated(totalValue);
|
balanceUpdateInterface.onBalanceUpdated(totalValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -496,6 +533,87 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
displayBalance(preferencesManager.isBalanceHidden());
|
displayBalance(preferencesManager.isBalanceHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTickerListUpdated() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDetailsUpdated() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBalanceDataUpdated() {
|
||||||
|
final List<Currency> balance = balanceManager.getTotalBalance();
|
||||||
|
|
||||||
|
if(balance.size() > 0)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < balance.size(); i++)
|
||||||
|
{
|
||||||
|
balance.get(i).updatePrice(getActivity(), defaultCurrency, new Currency.CurrencyCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Currency currency) {
|
||||||
|
countCoins(true, false, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
countCoins(false, false, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBalanceError(String error)
|
||||||
|
{
|
||||||
|
generateSnackBarError(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generateSnackBarError(String error)
|
||||||
|
{
|
||||||
|
View view = getActivity().findViewById(R.id.content_frame);
|
||||||
|
|
||||||
|
switch (error)
|
||||||
|
{
|
||||||
|
case "com.android.volley.AuthFailureError":
|
||||||
|
preferencesManager.disableHitBTC();
|
||||||
|
Snackbar.make(view, getString(R.string.invalid_keys_hitbtc), Snackbar.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
|
|
||||||
|
refreshLayout.setRefreshing(false);
|
||||||
|
|
||||||
|
updateAll(true);
|
||||||
|
break;
|
||||||
|
case "API-key format invalid.":
|
||||||
|
preferencesManager.disableBinance();
|
||||||
|
Snackbar.make(view, getString(R.string.invalid_keys_binance), Snackbar.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
|
|
||||||
|
updateAll(true);
|
||||||
|
break;
|
||||||
|
case "com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host \"api.hitbtc.com\": No address associated with hostname":
|
||||||
|
Snackbar.make(view, getString(R.string.cannot_resole_host), Snackbar.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
|
break;
|
||||||
|
case "com.android.volley.TimeoutError":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Snackbar.make(view, R.string.unexpected, Snackbar.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
|
|
||||||
|
Log.d("moodl", error);
|
||||||
|
|
||||||
|
updateAll(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class UiHeavyLoadCalculator extends AsyncTask<Void, Integer, Void>
|
private class UiHeavyLoadCalculator extends AsyncTask<Void, Integer, Void>
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -520,11 +638,11 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
{
|
{
|
||||||
Palette.Builder builder = Palette.from(currency.getIcon());
|
Palette.Builder builder = Palette.from(currency.getIcon());
|
||||||
|
|
||||||
currency.setChartColor(builder.generate().getDominantColor(0));
|
currency.setChartColor(builder.generate().getDominantColor(getColor(R.color.default_color, getContext())));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currency.setChartColor(12369084);
|
currency.setChartColor(getColor(R.color.default_color, getContext()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,7 +769,14 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_moodl);
|
Drawable drawable = getDrawable(R.drawable.ic_panorama_fish_eye_24dp, getContext());
|
||||||
|
|
||||||
|
Bitmap icon = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
|
||||||
|
Canvas canvas = new Canvas(icon);
|
||||||
|
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||||
|
drawable.draw(canvas);
|
||||||
|
|
||||||
icon = Bitmap.createScaledBitmap(icon, 50, 50, false);
|
icon = Bitmap.createScaledBitmap(icon, 50, 50, false);
|
||||||
|
|
||||||
localCurrency.setIcon(icon);
|
localCurrency.setIcon(icon);
|
||||||
@ -666,44 +791,6 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
|
|
||||||
private class DataUpdater extends AsyncTask<Void, Integer, Void>
|
private class DataUpdater extends AsyncTask<Void, Integer, Void>
|
||||||
{
|
{
|
||||||
private void generateSnackBarError(String error)
|
|
||||||
{
|
|
||||||
/*View view = getActivity().findViewById(R.id.snackbar_placer);
|
|
||||||
|
|
||||||
switch (error)
|
|
||||||
{
|
|
||||||
case "com.android.volley.AuthFailureError":
|
|
||||||
preferencesManager.disableHitBTC();
|
|
||||||
Snackbar.make(view, "HitBTC synchronization error : Invalid keys", Snackbar.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
|
|
||||||
refreshLayout.setRefreshing(false);
|
|
||||||
|
|
||||||
updateAll(true);
|
|
||||||
break;
|
|
||||||
case "API-key format invalid.":
|
|
||||||
preferencesManager.disableBinance();
|
|
||||||
Snackbar.make(view, "Binance synchronization error : Invalid keys", Snackbar.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
|
|
||||||
updateAll(true);
|
|
||||||
break;
|
|
||||||
case "com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host \"api.hitbtc.com\": No address associated with hostname":
|
|
||||||
Snackbar.make(view, "Can't resolve host", Snackbar.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
break;
|
|
||||||
case "com.android.volley.TimeoutError":
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Snackbar.make(view, "Unexpected error", Snackbar.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
|
|
||||||
Log.d("moodl", error);
|
|
||||||
|
|
||||||
updateAll(false);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... params)
|
protected Void doInBackground(Void... params)
|
||||||
{
|
{
|
||||||
@ -729,39 +816,7 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
balanceManager.updateTotalBalance(new com.herbron.moodl.DataManagers.BalanceManager.VolleyCallBack() {
|
balanceManager.updateTotalBalance();
|
||||||
@Override
|
|
||||||
public void onSuccess() {
|
|
||||||
final List<Currency> balance = balanceManager.getTotalBalance();
|
|
||||||
|
|
||||||
if(balanceManager.getTotalBalance().size() > 0)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < balanceManager.getTotalBalance().size(); i++)
|
|
||||||
{
|
|
||||||
balance.get(i).updatePrice(getActivity(), defaultCurrency, new Currency.CurrencyCallBack() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Currency currency) {
|
|
||||||
countCoins(true, false, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
countCoins(false, false, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onError(String error)
|
|
||||||
{
|
|
||||||
generateSnackBarError(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ import org.json.JSONObject;
|
|||||||
|
|
||||||
import static com.herbron.moodl.MoodlBox.collapseW;
|
import static com.herbron.moodl.MoodlBox.collapseW;
|
||||||
import static com.herbron.moodl.MoodlBox.expandW;
|
import static com.herbron.moodl.MoodlBox.expandW;
|
||||||
|
import static com.herbron.moodl.MoodlBox.getColor;
|
||||||
import static java.lang.Math.abs;
|
import static java.lang.Math.abs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -354,11 +355,11 @@ public class Watchlist extends Fragment {
|
|||||||
{
|
{
|
||||||
Palette.Builder builder = Palette.from(currency.getIcon());
|
Palette.Builder builder = Palette.from(currency.getIcon());
|
||||||
|
|
||||||
currency.setChartColor(builder.generate().getDominantColor(0));
|
currency.setChartColor(builder.generate().getDominantColor(getColor(R.color.default_color, getContext())));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currency.setChartColor(12369084);
|
currency.setChartColor(getColor(R.color.default_color, getContext()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
|||||||
import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
|
import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
|
||||||
import com.herbron.moodl.DataManagers.DatabaseManager;
|
import com.herbron.moodl.DataManagers.DatabaseManager;
|
||||||
import com.herbron.moodl.DataManagers.PreferencesManager;
|
import com.herbron.moodl.DataManagers.PreferencesManager;
|
||||||
|
import com.herbron.moodl.PlaceholderManager;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@ -168,7 +169,7 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if(transactionId != -1)
|
if(transactionId != -1)
|
||||||
{
|
{
|
||||||
setTitle("Edit " + coin + " transaction");
|
setTitle(PlaceholderManager.getEditTransactionString(coin, getBaseContext()));
|
||||||
|
|
||||||
DatabaseManager databaseManager = new DatabaseManager(this);
|
DatabaseManager databaseManager = new DatabaseManager(this);
|
||||||
Transaction transaction = databaseManager.getCurrencyTransactionById(transactionId);
|
Transaction transaction = databaseManager.getCurrencyTransactionById(transactionId);
|
||||||
@ -180,7 +181,7 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setTitle("Add " + coin + " transaction");
|
setTitle(getString(R.string.new_transaction));
|
||||||
|
|
||||||
purchaseDate.setText(sdf.format(calendar.getTime()));
|
purchaseDate.setText(sdf.format(calendar.getTime()));
|
||||||
symbolTxtView.setText(symbol);
|
symbolTxtView.setText(symbol);
|
||||||
@ -300,7 +301,6 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
purchasedPriceEditText.setText(price);
|
purchasedPriceEditText.setText(price);
|
||||||
}
|
}
|
||||||
}, calendar.getTimeInMillis() / 1000);
|
}, calendar.getTimeInMillis() / 1000);
|
||||||
Log.d("moodl", "Time : " + calendar.getTimeInMillis());
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
calendar.get(Calendar.HOUR_OF_DAY),
|
calendar.get(Calendar.HOUR_OF_DAY),
|
||||||
|
@ -2,40 +2,61 @@ package com.herbron.moodl.Activities;
|
|||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.app.KeyguardManager;
|
import android.app.KeyguardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.hardware.fingerprint.FingerprintManager;
|
import android.hardware.fingerprint.FingerprintManager;
|
||||||
import android.media.Ringtone;
|
|
||||||
import android.media.RingtoneManager;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
import android.preference.EditTextPreference;
|
import android.preference.EditTextPreference;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.preference.RingtonePreference;
|
|
||||||
import android.preference.SwitchPreference;
|
import android.preference.SwitchPreference;
|
||||||
import android.security.keystore.KeyGenParameterSpec;
|
import android.security.keystore.KeyGenParameterSpec;
|
||||||
import android.security.keystore.KeyPermanentlyInvalidatedException;
|
import android.security.keystore.KeyPermanentlyInvalidatedException;
|
||||||
import android.security.keystore.KeyProperties;
|
import android.security.keystore.KeyProperties;
|
||||||
|
import android.support.design.widget.TextInputLayout;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.text.TextUtils;
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.ExpandableListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.applandeo.FilePicker;
|
||||||
|
import com.applandeo.listeners.OnSelectFileListener;
|
||||||
import com.herbron.moodl.BuildConfig;
|
import com.herbron.moodl.BuildConfig;
|
||||||
|
import com.herbron.moodl.DataManagers.DataCrypter;
|
||||||
|
import com.herbron.moodl.DataManagers.DatabaseManager;
|
||||||
import com.herbron.moodl.FingerprintToolkit.FingerprintDialogFragment;
|
import com.herbron.moodl.FingerprintToolkit.FingerprintDialogFragment;
|
||||||
import com.herbron.moodl.FingerprintToolkit.FingerprintHandler;
|
import com.herbron.moodl.FingerprintToolkit.FingerprintHandler;
|
||||||
|
import com.herbron.moodl.MoodlBox;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
import java.security.InvalidAlgorithmParameterException;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
@ -44,7 +65,13 @@ import java.security.NoSuchAlgorithmException;
|
|||||||
import java.security.NoSuchProviderException;
|
import java.security.NoSuchProviderException;
|
||||||
import java.security.UnrecoverableKeyException;
|
import java.security.UnrecoverableKeyException;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.KeyGenerator;
|
import javax.crypto.KeyGenerator;
|
||||||
@ -166,7 +193,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
@Override
|
@Override
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
public void onBuildHeaders(List<Header> target) {
|
public void onBuildHeaders(List<Header> target) {
|
||||||
loadHeadersFromResource(R.xml.pref_headers, target);
|
//loadHeadersFromResource(R.xml.pref_headers, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -175,41 +202,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
*/
|
*/
|
||||||
protected boolean isValidFragment(String fragmentName) {
|
protected boolean isValidFragment(String fragmentName) {
|
||||||
return PreferenceFragment.class.getName().equals(fragmentName)
|
return PreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
|| ExchangePreferenceFragment.class.getName().equals(fragmentName)
|
||||||
|| ExchangePreferenceFragment.class.getName().equals(fragmentName);
|
|| MainPreferenceFragment.class.getName().equals(fragmentName);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This fragment shows general preferences only. It is used when the
|
|
||||||
* activity is showing a two-pane settings UI.
|
|
||||||
*/
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public static class GeneralPreferenceFragment extends PreferenceFragment {
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.pref_general);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
findPreference("version").setSummary(BuildConfig.VERSION_NAME);
|
|
||||||
|
|
||||||
bindPreferenceSummaryToValue(findPreference("default_currency"));
|
|
||||||
bindPreferenceSummaryToValue(findPreference("minimum_value_displayed"));
|
|
||||||
|
|
||||||
EditTextPreference editTextPreference = (EditTextPreference) findPreference("minimum_value_displayed");
|
|
||||||
editTextPreference.setPositiveButtonText("Save");
|
|
||||||
editTextPreference.setNegativeButtonText("Cancel");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == android.R.id.home) {
|
|
||||||
//startActivity(new Intent(getActivity(), SettingsActivity.class));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
@ -236,6 +230,14 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
bindPreferenceSummaryToValue(findPreference("hitbtc_privatekey"));
|
bindPreferenceSummaryToValue(findPreference("hitbtc_privatekey"));
|
||||||
bindPreferenceSummaryToValue(findPreference("binance_privatekey"));
|
bindPreferenceSummaryToValue(findPreference("binance_privatekey"));
|
||||||
|
|
||||||
|
findPreference("enable_fingerprint").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
findPreference("enable_hitbtc").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
findPreference("enable_hitbtc").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(Preference preference) {
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
@ -397,4 +399,421 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
|
public static class MainPreferenceFragment extends PreferenceFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
addPreferencesFromResource(R.xml.pref_main);
|
||||||
|
|
||||||
|
findPreference("version").setSummary(BuildConfig.VERSION_NAME);
|
||||||
|
|
||||||
|
bindPreferenceSummaryToValue(findPreference("default_currency"));
|
||||||
|
bindPreferenceSummaryToValue(findPreference("minimum_value_displayed"));
|
||||||
|
|
||||||
|
findPreference("export").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
|
|
||||||
|
Context context = getContext();
|
||||||
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
|
||||||
|
View dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_export_data, null, true);
|
||||||
|
dialogBuilder.setView(dialogView);
|
||||||
|
|
||||||
|
final CheckBox backupManualEntriesCheckbox = dialogView.findViewById(R.id.checkboxBackupManualEntries);
|
||||||
|
final CheckBox backupWatchlistCheckbox = dialogView.findViewById(R.id.checkboxBackupWatchlist);
|
||||||
|
final CheckBox backupKeysCheckbox = dialogView.findViewById(R.id.checkboxBackupKeys);
|
||||||
|
final CheckBox enterPasswordCheckbox = dialogView.findViewById(R.id.checkboxEnterPassword);
|
||||||
|
final TextInputLayout textInputLayoutPassword = dialogView.findViewById(R.id.textInputLayoutPassword);
|
||||||
|
final TextView textViewFilePath = dialogView.findViewById(R.id.textViewFilePath);
|
||||||
|
|
||||||
|
File backupDirectory = new File(Environment.getExternalStorageDirectory(), getString(R.string.app_name));
|
||||||
|
|
||||||
|
createDefaultBackupDirectory(backupDirectory);
|
||||||
|
|
||||||
|
textViewFilePath.setText(backupDirectory.getAbsolutePath());
|
||||||
|
textViewFilePath.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
new FilePicker.Builder(getActivity(), new OnSelectFileListener() {
|
||||||
|
@Override
|
||||||
|
public void onSelect(File file) {
|
||||||
|
textViewFilePath.setText(file.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}).fileType(".moodl")
|
||||||
|
.hideFiles(true)
|
||||||
|
.directory(backupDirectory.getAbsolutePath())
|
||||||
|
.mainDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
enterPasswordCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||||
|
if(b && textInputLayoutPassword.getVisibility() == View.GONE)
|
||||||
|
{
|
||||||
|
MoodlBox.expandH(textInputLayoutPassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!b && textInputLayoutPassword.getVisibility() == View.VISIBLE)
|
||||||
|
{
|
||||||
|
MoodlBox.collapseH(textInputLayoutPassword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogBuilder.setTitle(getString(R.string.create_backup));
|
||||||
|
dialogBuilder.setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
|
||||||
|
checkPermissions();
|
||||||
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss", Locale.getDefault());
|
||||||
|
Date currentDate = new Date();
|
||||||
|
String fileName = "Bakup_" + formatter.format(currentDate) + ".moodl";
|
||||||
|
DatabaseManager databaseManager = new DatabaseManager(getContext());
|
||||||
|
|
||||||
|
if(enterPasswordCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
if(textInputLayoutPassword.getEditText().getText().equals(""))
|
||||||
|
{
|
||||||
|
textInputLayoutPassword.setError(getString(R.string.must_be_filled));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataCrypter.updateKey(textInputLayoutPassword.getEditText().getText().toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
File backupFile = new File(textViewFilePath.getText() + "/" + fileName);
|
||||||
|
|
||||||
|
try (PrintWriter printWriter = new PrintWriter(new FileWriter(backupFile, true))) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
JSONObject backupJson = new JSONObject();
|
||||||
|
|
||||||
|
initiateJsonBackup(backupJson, enterPasswordCheckbox.isChecked());
|
||||||
|
|
||||||
|
if(backupManualEntriesCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
backupJson.put("transactions",
|
||||||
|
databaseManager.getDatabaseBackup(getContext(),
|
||||||
|
DatabaseManager.TABLE_MANUAL_CURRENCIES,
|
||||||
|
enterPasswordCheckbox.isChecked()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(backupWatchlistCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
backupJson.put("watchlist",
|
||||||
|
databaseManager.getDatabaseBackup(getContext(),
|
||||||
|
DatabaseManager.TABLE_WATCHLIST,
|
||||||
|
enterPasswordCheckbox.isChecked()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(backupKeysCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
backupJson.put("apiKeys",
|
||||||
|
databaseManager.getDatabaseBackup(getContext(),
|
||||||
|
DatabaseManager.TABLE_EXCHANGE_KEYS,
|
||||||
|
enterPasswordCheckbox.isChecked()));
|
||||||
|
}
|
||||||
|
|
||||||
|
printWriter.write(backupJson.toString());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.d("moodl", "Error while creating backup json " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
printWriter.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.d("moodl", "Error > " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogBuilder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AlertDialog alertDialog = dialogBuilder.create();
|
||||||
|
alertDialog.show();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference("import").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
|
|
||||||
|
Context context = getContext();
|
||||||
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
|
||||||
|
View dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_import_data, null, true);
|
||||||
|
dialogBuilder.setView(dialogView);
|
||||||
|
|
||||||
|
final TextView textViewFilePath = dialogView.findViewById(R.id.textViewFilePath);
|
||||||
|
final TextInputLayout textInputLayoutPassword = dialogView.findViewById(R.id.textInputLayoutPassword);
|
||||||
|
final CheckBox enterPasswordCheckbox = dialogView.findViewById(R.id.checkboxEnterPassword);
|
||||||
|
final CheckBox restoreManualEntriesCheckbox = dialogView.findViewById(R.id.checkboxRestoreEntries);
|
||||||
|
final CheckBox restoreWatchlistCheckbox = dialogView.findViewById(R.id.checkboxRestoreWatchlist);
|
||||||
|
final CheckBox restoreApiKeysCheckbox = dialogView.findViewById(R.id.checkboxRestoreKeys);
|
||||||
|
|
||||||
|
final CheckBox wipeManualEntriesCheckbox = dialogView.findViewById(R.id.checkboxWipeManualEntries);
|
||||||
|
final CheckBox wipeWatchlistCheckbox = dialogView.findViewById(R.id.checkboxWipeWatchlist);
|
||||||
|
final CheckBox wipeApiKeyxCheckbox = dialogView.findViewById(R.id.checkboxWipeAPIKeys);
|
||||||
|
|
||||||
|
restoreManualEntriesCheckbox.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if(restoreManualEntriesCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
MoodlBox.expandH(wipeManualEntriesCheckbox);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MoodlBox.collapseH(wipeManualEntriesCheckbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
restoreWatchlistCheckbox.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if(restoreWatchlistCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
MoodlBox.expandH(wipeWatchlistCheckbox);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MoodlBox.collapseH(wipeWatchlistCheckbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
restoreApiKeysCheckbox.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if(restoreApiKeysCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
MoodlBox.expandH(wipeApiKeyxCheckbox);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MoodlBox.collapseH(wipeApiKeyxCheckbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
enterPasswordCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||||
|
if(b && textInputLayoutPassword.getVisibility() == View.GONE)
|
||||||
|
{
|
||||||
|
MoodlBox.expandH(textInputLayoutPassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!b && textInputLayoutPassword.getVisibility() == View.VISIBLE)
|
||||||
|
{
|
||||||
|
MoodlBox.collapseH(textInputLayoutPassword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
File backupDirectory = new File(Environment.getExternalStorageDirectory(), getString(R.string.app_name));
|
||||||
|
|
||||||
|
createDefaultBackupDirectory(backupDirectory);
|
||||||
|
|
||||||
|
textViewFilePath.setText(backupDirectory.getAbsolutePath());
|
||||||
|
textViewFilePath.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
new FilePicker.Builder(getActivity(), new OnSelectFileListener() {
|
||||||
|
@Override
|
||||||
|
public void onSelect(File file) {
|
||||||
|
textViewFilePath.setText(file.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}).hideFiles(false)
|
||||||
|
.directory(backupDirectory.getAbsolutePath())
|
||||||
|
.mainDirectory(Environment.getExternalStorageDirectory().getAbsolutePath())
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogBuilder.setTitle(getString(R.string.restoreBackup));
|
||||||
|
dialogBuilder.setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int whichButton) {
|
||||||
|
|
||||||
|
checkPermissions();
|
||||||
|
|
||||||
|
DatabaseManager databaseManager = new DatabaseManager(context);
|
||||||
|
|
||||||
|
if(enterPasswordCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
DataCrypter.updateKey(textInputLayoutPassword.getEditText().getText().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
File backupFile = new File(textViewFilePath.getText().toString());
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileReader fileReader = new FileReader(backupFile);
|
||||||
|
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
||||||
|
|
||||||
|
String str;
|
||||||
|
String completeFile = "";
|
||||||
|
|
||||||
|
while ((str = bufferedReader.readLine()) != null) {
|
||||||
|
completeFile += str;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
JSONObject backupJson = new JSONObject(completeFile);
|
||||||
|
String checker;
|
||||||
|
|
||||||
|
if(enterPasswordCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
checker = DataCrypter.decrypt(getContext(), backupJson.getString("encodeChecker"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checker = backupJson.getString("encodeChecker");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(checker.equals("NaukVerification"))
|
||||||
|
{
|
||||||
|
if(restoreManualEntriesCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
if(wipeManualEntriesCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
databaseManager.wipeData(DatabaseManager.TABLE_MANUAL_CURRENCIES);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(backupJson.has("transactions"))
|
||||||
|
{
|
||||||
|
JSONArray transactionsArray = backupJson.getJSONArray("transactions");
|
||||||
|
|
||||||
|
for(int i = 0; i < transactionsArray.length(); i++)
|
||||||
|
{
|
||||||
|
JSONObject transactionObject = transactionsArray.getJSONObject(i);
|
||||||
|
|
||||||
|
databaseManager.addRowTransaction(transactionObject, getContext(), enterPasswordCheckbox.isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(restoreWatchlistCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
if(wipeWatchlistCheckbox.isChecked())
|
||||||
|
{
|
||||||
|
databaseManager.wipeData(DatabaseManager.TABLE_WATCHLIST);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(backupJson.has("watchlist"))
|
||||||
|
{
|
||||||
|
JSONArray watchlistArray = backupJson.getJSONArray("watchlist");
|
||||||
|
|
||||||
|
for(int i = 0; i < watchlistArray.length(); i++)
|
||||||
|
{
|
||||||
|
JSONObject transactionObject = watchlistArray.getJSONObject(i);
|
||||||
|
|
||||||
|
databaseManager.addRowWatchlist(transactionObject, getContext(), enterPasswordCheckbox.isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textInputLayoutPassword.setError(getString(R.string.wrong_password));
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.d("moodl", "Error while creating backup json " + e);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogBuilder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
dialogInterface.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AlertDialog alertDialog = dialogBuilder.create();
|
||||||
|
alertDialog.show();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
EditTextPreference editTextPreference = (EditTextPreference) findPreference("minimum_value_displayed");
|
||||||
|
editTextPreference.setPositiveButtonText(getString(R.string.save));
|
||||||
|
editTextPreference.setNegativeButtonText(getString(R.string.cancel));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initiateJsonBackup(JSONObject backupJson, boolean mustEncrypt) throws JSONException
|
||||||
|
{
|
||||||
|
if(mustEncrypt)
|
||||||
|
{
|
||||||
|
backupJson.put("encodeChecker", DataCrypter.encrypt(getContext(), "NaukVerification"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
backupJson.put("encodeChecker", "NaukVerification");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createDefaultBackupDirectory(File backupDirectory)
|
||||||
|
{
|
||||||
|
if (!backupDirectory.exists()) {
|
||||||
|
if (!backupDirectory.mkdirs()) {
|
||||||
|
Log.d("moodl", "Error while creating directory");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkPermissions() {
|
||||||
|
|
||||||
|
String[] permissions = new String[]{
|
||||||
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
|
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
|
};
|
||||||
|
|
||||||
|
int result;
|
||||||
|
List<String> listPermissionsNeeded = new ArrayList<>();
|
||||||
|
for (String p : permissions) {
|
||||||
|
result = ContextCompat.checkSelfPermission(getContext(), p);
|
||||||
|
if (result != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
listPermissionsNeeded.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!listPermissionsNeeded.isEmpty()) {
|
||||||
|
ActivityCompat.requestPermissions(getActivity(), listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), 100);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == android.R.id.home) {
|
||||||
|
//startActivity(new Intent(getActivity(), SettingsActivity.class));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,12 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.android.volley.RequestQueue;
|
import com.android.volley.RequestQueue;
|
||||||
import com.android.volley.toolbox.Volley;
|
import com.android.volley.toolbox.Volley;
|
||||||
|
import com.herbron.moodl.Activities.HomeActivity;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
|
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
|
||||||
import com.herbron.moodl.DataManagers.ExchangeManager.BinanceManager;
|
import com.herbron.moodl.DataManagers.ExchangeManager.BinanceManager;
|
||||||
import com.herbron.moodl.DataManagers.ExchangeManager.HitBtcManager;
|
import com.herbron.moodl.DataManagers.ExchangeManager.HitBtcManager;
|
||||||
|
import com.herbron.moodl.DataNotifierInterface;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
@ -49,6 +51,8 @@ public class BalanceManager {
|
|||||||
private List<HitBtcManager> hitBtcManagers;
|
private List<HitBtcManager> hitBtcManagers;
|
||||||
private List<BinanceManager> binanceManagers;
|
private List<BinanceManager> binanceManagers;
|
||||||
|
|
||||||
|
private DataNotifierInterface dataNotifierInterface;
|
||||||
|
|
||||||
public BalanceManager(android.content.Context context)
|
public BalanceManager(android.content.Context context)
|
||||||
{
|
{
|
||||||
this.context = context;
|
this.context = context;
|
||||||
@ -64,6 +68,13 @@ public class BalanceManager {
|
|||||||
currencyDetailsList = CurrencyDetailsList.getInstance(context);
|
currencyDetailsList = CurrencyDetailsList.getInstance(context);
|
||||||
|
|
||||||
balanceCounter = 0;
|
balanceCounter = 0;
|
||||||
|
|
||||||
|
setListener((DataNotifierInterface) ((HomeActivity) context).getHoldingsFragment());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListener(DataNotifierInterface dataNotifierInterface)
|
||||||
|
{
|
||||||
|
this.dataNotifierInterface = dataNotifierInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getBiggestCurrencies()
|
public List<String> getBiggestCurrencies()
|
||||||
@ -111,7 +122,7 @@ public class BalanceManager {
|
|||||||
return totalBalance;
|
return totalBalance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTotalBalance(final VolleyCallBack callBack)
|
public void updateTotalBalance()
|
||||||
{
|
{
|
||||||
boolean isUpdated = false;
|
boolean isUpdated = false;
|
||||||
|
|
||||||
@ -128,12 +139,12 @@ public class BalanceManager {
|
|||||||
binanceManagers.get(i).updateBalance(new BinanceManager.BinanceCallBack() {
|
binanceManagers.get(i).updateBalance(new BinanceManager.BinanceCallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
countBalances(callBack);
|
countBalances();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
callBack.onError(error);
|
dataNotifierInterface.onBalanceError(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -148,12 +159,12 @@ public class BalanceManager {
|
|||||||
hitBtcManagers.get(i).updateGlobalBalance(new HitBtcManager.HitBtcCallBack() {
|
hitBtcManagers.get(i).updateGlobalBalance(new HitBtcManager.HitBtcCallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
countBalances(callBack);
|
countBalances();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
callBack.onError(error);
|
dataNotifierInterface.onBalanceError(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -161,23 +172,23 @@ public class BalanceManager {
|
|||||||
|
|
||||||
if(!isUpdated)
|
if(!isUpdated)
|
||||||
{
|
{
|
||||||
refreshAllBalances(callBack);
|
refreshAllBalances();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void countBalances(VolleyCallBack callBack)
|
private void countBalances()
|
||||||
{
|
{
|
||||||
balanceCounter++;
|
balanceCounter++;
|
||||||
|
|
||||||
if(balanceCounter == hitBtcManagers.size() + binanceManagers.size())
|
if(balanceCounter == hitBtcManagers.size() + binanceManagers.size())
|
||||||
{
|
{
|
||||||
refreshAllBalances(callBack);
|
refreshAllBalances();
|
||||||
|
|
||||||
balanceCounter = 0;
|
balanceCounter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshAllBalances(final VolleyCallBack callBack)
|
private void refreshAllBalances()
|
||||||
{
|
{
|
||||||
totalBalance = new ArrayList<>();
|
totalBalance = new ArrayList<>();
|
||||||
|
|
||||||
@ -193,7 +204,7 @@ public class BalanceManager {
|
|||||||
|
|
||||||
mergeBalanceTotal(manualBalances);
|
mergeBalanceTotal(manualBalances);
|
||||||
|
|
||||||
callBack.onSuccess();
|
dataNotifierInterface.onBalanceDataUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mergeBalanceTotal(List<Currency> balance)
|
private void mergeBalanceTotal(List<Currency> balance)
|
||||||
@ -257,23 +268,6 @@ public class BalanceManager {
|
|||||||
{
|
{
|
||||||
callBack.onSuccess();
|
callBack.onSuccess();
|
||||||
}
|
}
|
||||||
/*StringRequest strRequest = new StringRequest(Request.Method.GET, detailUrl,
|
|
||||||
new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
if (response.length() > 0) {
|
|
||||||
processDetailResult(response, callBack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
requestQueue.add(strRequest);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIconUrl(String symbol)
|
public String getIconUrl(String symbol)
|
||||||
|
@ -4,6 +4,7 @@ import android.graphics.Bitmap;
|
|||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@ -92,25 +93,6 @@ public class Currency implements Parcelable {
|
|||||||
}, timestamp);
|
}, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getIconUrl(String currencyDetails)
|
|
||||||
{
|
|
||||||
String url;
|
|
||||||
|
|
||||||
try {
|
|
||||||
JSONObject jsonObject = new JSONObject(currencyDetails);
|
|
||||||
url = "https://www.cryptocompare.com" + jsonObject.getString("ImageUrl") + "?width=50";
|
|
||||||
|
|
||||||
} catch (NullPointerException e) {
|
|
||||||
//Log.d(context.getResources().getString(R.string.debug), symbol + " has no icon URL");
|
|
||||||
url = null;
|
|
||||||
} catch (JSONException e) {
|
|
||||||
//Log.d(context.getResources().getString(R.string.debug), "Url parsing error for " + symbol);
|
|
||||||
url = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updatePrice(android.content.Context context, String toSymbol, final CurrencyCallBack callBack)
|
public void updatePrice(android.content.Context context, String toSymbol, final CurrencyCallBack callBack)
|
||||||
{
|
{
|
||||||
dataRetriver = new CurrencyDataRetriever(context);
|
dataRetriver = new CurrencyDataRetriever(context);
|
||||||
|
@ -12,6 +12,7 @@ import android.os.Build;
|
|||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -35,6 +36,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import static com.herbron.moodl.MoodlBox.collapseH;
|
import static com.herbron.moodl.MoodlBox.collapseH;
|
||||||
import static com.herbron.moodl.MoodlBox.expandH;
|
import static com.herbron.moodl.MoodlBox.expandH;
|
||||||
|
import static com.herbron.moodl.MoodlBox.getColor;
|
||||||
import static com.herbron.moodl.MoodlBox.numberConformer;
|
import static com.herbron.moodl.MoodlBox.numberConformer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -212,7 +214,8 @@ public class CurrencyCardview extends CardView {
|
|||||||
private void setupCardView()
|
private void setupCardView()
|
||||||
{
|
{
|
||||||
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT);
|
ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.MarginLayoutParams.MATCH_PARENT, ViewGroup.MarginLayoutParams.WRAP_CONTENT);
|
||||||
layoutParams.setMargins((int) MoodlBox.convertDpToPx(10, getResources()), 0, (int) MoodlBox.convertDpToPx(10, getResources()), (int) MoodlBox.convertDpToPx(10, getResources()));
|
int margin = (int) MoodlBox.convertDpToPx(10, getResources());
|
||||||
|
layoutParams.setMargins(margin, margin, margin, 0);
|
||||||
|
|
||||||
setLayoutParams(layoutParams);
|
setLayoutParams(layoutParams);
|
||||||
|
|
||||||
@ -340,9 +343,9 @@ public class CurrencyCardview extends CardView {
|
|||||||
dataSet = new LineDataSet(values, "");
|
dataSet = new LineDataSet(values, "");
|
||||||
dataSet.setDrawIcons(false);
|
dataSet.setDrawIcons(false);
|
||||||
dataSet.setColor(currency.getChartColor());
|
dataSet.setColor(currency.getChartColor());
|
||||||
|
dataSet.setFillColor(getColorWithAplha(currency.getChartColor(), 0.5f));
|
||||||
dataSet.setLineWidth(1);
|
dataSet.setLineWidth(1);
|
||||||
dataSet.setDrawFilled(true);
|
dataSet.setDrawFilled(true);
|
||||||
dataSet.setFillColor(getColorWithAplha(currency.getChartColor(), 0.5f));
|
|
||||||
dataSet.setFormLineWidth(1);
|
dataSet.setFormLineWidth(1);
|
||||||
dataSet.setFormSize(15);
|
dataSet.setFormSize(15);
|
||||||
dataSet.setDrawCircles(false);
|
dataSet.setDrawCircles(false);
|
||||||
|
@ -53,17 +53,16 @@ public class CurrencyDetailsList {
|
|||||||
new Response.Listener<String>() {
|
new Response.Listener<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(String response) {
|
public void onResponse(String response) {
|
||||||
|
|
||||||
if (response.length() > 0) {
|
if (response.length() > 0) {
|
||||||
processDetailResult(response, callBack);
|
processDetailResult(response, callBack);
|
||||||
|
|
||||||
}
|
}
|
||||||
upToDate = true;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Response.ErrorListener() {
|
new Response.ErrorListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onErrorResponse(VolleyError error) {
|
public void onErrorResponse(VolleyError error) {
|
||||||
upToDate = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ public class CurrencyDetailsList {
|
|||||||
|
|
||||||
private void processDetailResult(String response, final BalanceManager.IconCallBack callBack)
|
private void processDetailResult(String response, final BalanceManager.IconCallBack callBack)
|
||||||
{
|
{
|
||||||
response = response.substring(response.indexOf("\"Data\"") + 7, response.lastIndexOf("},\"Type\":100}"));
|
response = response.substring(response.indexOf("\"Data\"") + 7, response.lastIndexOf("},\"BaseImageUrl\""));
|
||||||
String[] tab = response.split(Pattern.quote("},"));
|
String[] tab = response.split(Pattern.quote("},"));
|
||||||
|
|
||||||
coinInfosHashmap = new LinkedHashMap<>();
|
coinInfosHashmap = new LinkedHashMap<>();
|
||||||
@ -109,6 +108,8 @@ public class CurrencyDetailsList {
|
|||||||
|
|
||||||
sortDetails();
|
sortDetails();
|
||||||
|
|
||||||
|
upToDate = true;
|
||||||
|
|
||||||
callBack.onSuccess();
|
callBack.onSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,89 @@
|
|||||||
|
package com.herbron.moodl.DataManagers;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
import android.util.Base64;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.InvalidAlgorithmParameterException;
|
||||||
|
import java.security.InvalidKeyException;
|
||||||
|
import java.security.Key;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
import javax.crypto.BadPaddingException;
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
|
import javax.crypto.NoSuchPaddingException;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
|
|
||||||
|
public class DataCrypter {
|
||||||
|
|
||||||
|
private static Key aesKey;
|
||||||
|
|
||||||
|
public static void updateKey(String key)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
byte[] keyByte = key.getBytes("UTF-8");
|
||||||
|
byte[] finalKey = new byte[32];
|
||||||
|
System.arraycopy(keyByte, 0, finalKey, 0, keyByte.length);
|
||||||
|
|
||||||
|
aesKey = new SecretKeySpec(finalKey, "AES");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
Log.d("moodl", "Error while creating encryption key " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String encrypt(Context context, String data)
|
||||||
|
{
|
||||||
|
String encryptedData = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
IvParameterSpec ivParameterSpec = new IvParameterSpec(context.getString(R.string.ivKey).getBytes("UTF-8"));
|
||||||
|
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, aesKey, ivParameterSpec);
|
||||||
|
|
||||||
|
byte[] encryptedBytes = cipher.doFinal(data.getBytes("UTF-8"));
|
||||||
|
|
||||||
|
encryptedData = Base64.encodeToString(encryptedBytes, Base64.DEFAULT);
|
||||||
|
|
||||||
|
} catch (NoSuchPaddingException | NoSuchAlgorithmException
|
||||||
|
| InvalidKeyException | BadPaddingException
|
||||||
|
| IllegalBlockSizeException | UnsupportedEncodingException
|
||||||
|
| InvalidAlgorithmParameterException e) {
|
||||||
|
|
||||||
|
Log.d("moodl", "Error while encrypting data " + e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return encryptedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String decrypt(Context context, String data)
|
||||||
|
{
|
||||||
|
String decryptedData = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
IvParameterSpec ivParameterSpec = new IvParameterSpec(context.getString(R.string.ivKey).getBytes("UTF-8"));
|
||||||
|
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, aesKey, ivParameterSpec);
|
||||||
|
|
||||||
|
byte[] dataBytes = Base64.decode(data, Base64.DEFAULT);
|
||||||
|
decryptedData = new String(dataBytes, StandardCharsets.UTF_8);
|
||||||
|
|
||||||
|
} catch(NoSuchPaddingException | NoSuchAlgorithmException
|
||||||
|
| InvalidKeyException | UnsupportedEncodingException
|
||||||
|
| InvalidAlgorithmParameterException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return decryptedData;
|
||||||
|
}
|
||||||
|
}
|
@ -5,10 +5,15 @@ import android.content.Context;
|
|||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteOpenHelper;
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
|
import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -19,13 +24,13 @@ import java.util.List;
|
|||||||
|
|
||||||
public class DatabaseManager extends SQLiteOpenHelper{
|
public class DatabaseManager extends SQLiteOpenHelper{
|
||||||
|
|
||||||
private static final int DATABASE_VERSION = 6;
|
private static final int DATABASE_VERSION = 7;
|
||||||
|
|
||||||
private static final String DATABASE_NAME = "Currencies.db";
|
private static final String DATABASE_NAME = "Currencies.db";
|
||||||
|
|
||||||
private static final String TABLE_MANUAL_CURRENCIES = "ManualCurrencies";
|
public static final String TABLE_MANUAL_CURRENCIES = "ManualCurrencies";
|
||||||
private static final String TABLE_EXCHANGE_KEYS = "ExchangeKeys";
|
public static final String TABLE_EXCHANGE_KEYS = "ExchangeKeys";
|
||||||
private static final String TABLE_WATCHLIST = "Watchlist";
|
public static final String TABLE_WATCHLIST = "Watchlist";
|
||||||
|
|
||||||
private static final String KEY_CURRENCY_ID = "idCurrency";
|
private static final String KEY_CURRENCY_ID = "idCurrency";
|
||||||
private static final String KEY_CURRENCY_SYMBOL = "symbol";
|
private static final String KEY_CURRENCY_SYMBOL = "symbol";
|
||||||
@ -38,6 +43,7 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
|||||||
|
|
||||||
private static final String KEY_EXCHANGE_ID = "idExchange";
|
private static final String KEY_EXCHANGE_ID = "idExchange";
|
||||||
private static final String KEY_EXCHANGE_NAME = "name";
|
private static final String KEY_EXCHANGE_NAME = "name";
|
||||||
|
private static final String KEY_EXCHANGE_DESCRIPTION = "description";
|
||||||
private static final String KEY_EXCHANGE_PUBLIC_KEY = "publicKey";
|
private static final String KEY_EXCHANGE_PUBLIC_KEY = "publicKey";
|
||||||
private static final String KEY_EXCHANGE_SECRET_KEY = "secretKey";
|
private static final String KEY_EXCHANGE_SECRET_KEY = "secretKey";
|
||||||
|
|
||||||
@ -68,6 +74,7 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
|||||||
db.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_EXCHANGE_KEYS + "("
|
db.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_EXCHANGE_KEYS + "("
|
||||||
+ KEY_EXCHANGE_ID + " INTEGER PRIMARY KEY,"
|
+ KEY_EXCHANGE_ID + " INTEGER PRIMARY KEY,"
|
||||||
+ KEY_EXCHANGE_NAME + " TEXT,"
|
+ KEY_EXCHANGE_NAME + " TEXT,"
|
||||||
|
+ KEY_EXCHANGE_DESCRIPTION + " TEXT,"
|
||||||
+ KEY_EXCHANGE_PUBLIC_KEY + " TEXT,"
|
+ KEY_EXCHANGE_PUBLIC_KEY + " TEXT,"
|
||||||
+ KEY_EXCHANGE_SECRET_KEY + " TEXT"
|
+ KEY_EXCHANGE_SECRET_KEY + " TEXT"
|
||||||
+ ");");
|
+ ");");
|
||||||
@ -85,11 +92,12 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
|||||||
@Override
|
@Override
|
||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
|
||||||
{
|
{
|
||||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_MANUAL_CURRENCIES);
|
switch (oldVersion)
|
||||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_EXCHANGE_KEYS);
|
{
|
||||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_WATCHLIST);
|
case 6:
|
||||||
|
db.execSQL("ALTER TABLE " + TABLE_EXCHANGE_KEYS
|
||||||
onCreate(db);
|
+ " ADD " + KEY_EXCHANGE_DESCRIPTION+ " VARCHAR");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCurrencyInWatchlist(String symbol)
|
private boolean isCurrencyInWatchlist(String symbol)
|
||||||
@ -144,11 +152,119 @@ public class DatabaseManager extends SQLiteOpenHelper{
|
|||||||
return result.getInt(0);
|
return result.getInt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteCurrencyFromWatchlist(String symbol)
|
public void deleteCurrencyFromWatchlist(String symbol)
|
||||||
{
|
{
|
||||||
SQLiteDatabase db = this.getWritableDatabase();
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
|
||||||
return db.delete(TABLE_WATCHLIST, KEY_WATCHLIST_SYMBOL + " = '" + symbol + "'", null);
|
db.delete(TABLE_WATCHLIST, KEY_WATCHLIST_SYMBOL + " = '" + symbol + "'", null);
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONArray getDatabaseBackup(Context context, String table, boolean encryptData)
|
||||||
|
{
|
||||||
|
String selectQuerry = "SELECT * FROM " + table;
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
Cursor result = db.rawQuery(selectQuerry, null);
|
||||||
|
|
||||||
|
JSONArray backupArray = new JSONArray();
|
||||||
|
|
||||||
|
while(result.moveToNext())
|
||||||
|
{
|
||||||
|
JSONObject backupObject = new JSONObject();
|
||||||
|
|
||||||
|
for(int i = 0; i < result.getColumnCount(); i++)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if(result.getString(i) != null)
|
||||||
|
{
|
||||||
|
if(encryptData)
|
||||||
|
{
|
||||||
|
backupObject.put(result.getColumnName(i), DataCrypter.encrypt(context, result.getString(i)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
backupObject.put(result.getColumnName(i), result.getString(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
backupObject.put(result.getColumnName(i), "");
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.d("moodl", "Error while creating a json backup");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
backupArray.put(backupObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
return backupArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void wipeData(String table)
|
||||||
|
{
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
db.execSQL("DELETE FROM "+ table);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addRowWatchlist(JSONObject rawValues, Context context, boolean decrypt)
|
||||||
|
{
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(decrypt)
|
||||||
|
{
|
||||||
|
values.put(KEY_WATCHLIST_SYMBOL, DataCrypter.decrypt(context, rawValues.getString(KEY_WATCHLIST_SYMBOL)));
|
||||||
|
values.put(KEY_WATCHLIST_NAME, DataCrypter.decrypt(context, rawValues.getString(KEY_WATCHLIST_NAME)));
|
||||||
|
values.put(KEY_WATCHLIST_POSITION, DataCrypter.decrypt(context, rawValues.getString(KEY_WATCHLIST_POSITION)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
values.put(KEY_WATCHLIST_SYMBOL, rawValues.getString(KEY_WATCHLIST_SYMBOL));
|
||||||
|
values.put(KEY_WATCHLIST_NAME, rawValues.getString(KEY_WATCHLIST_NAME));
|
||||||
|
values.put(KEY_WATCHLIST_POSITION, rawValues.getString(KEY_WATCHLIST_POSITION));
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.d("moodl", "Error while inserting transaction");
|
||||||
|
}
|
||||||
|
|
||||||
|
db.insert(TABLE_MANUAL_CURRENCIES, null, values);
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addRowTransaction(JSONObject rawValues, Context context, boolean decrypt)
|
||||||
|
{
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(decrypt)
|
||||||
|
{
|
||||||
|
values.put(KEY_CURRENCY_SYMBOL, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_SYMBOL)));
|
||||||
|
values.put(KEY_CURRENCY_NAME, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_NAME)));
|
||||||
|
values.put(KEY_CURRENCY_BALANCE, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_BALANCE)));
|
||||||
|
values.put(KEY_CURRENCY_DATE, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_DATE)));
|
||||||
|
values.put(KEY_CURRENCY_PURCHASED_PRICE, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_PURCHASED_PRICE)));
|
||||||
|
values.put(KEY_CURRENCY_IS_MINED, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_IS_MINED)));
|
||||||
|
values.put(KEY_CURRENCY_FEES, DataCrypter.decrypt(context, rawValues.getString(KEY_CURRENCY_FEES)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
values.put(KEY_CURRENCY_SYMBOL, rawValues.getString(KEY_CURRENCY_SYMBOL));
|
||||||
|
values.put(KEY_CURRENCY_NAME, rawValues.getString(KEY_CURRENCY_NAME));
|
||||||
|
values.put(KEY_CURRENCY_BALANCE, rawValues.getString(KEY_CURRENCY_BALANCE));
|
||||||
|
values.put(KEY_CURRENCY_DATE, rawValues.getString(KEY_CURRENCY_DATE));
|
||||||
|
values.put(KEY_CURRENCY_PURCHASED_PRICE, rawValues.getString(KEY_CURRENCY_PURCHASED_PRICE));
|
||||||
|
values.put(KEY_CURRENCY_IS_MINED, rawValues.getString(KEY_CURRENCY_IS_MINED));
|
||||||
|
values.put(KEY_CURRENCY_FEES, rawValues.getString(KEY_CURRENCY_FEES));
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.d("moodl", "Error while inserting transaction");
|
||||||
|
}
|
||||||
|
|
||||||
|
db.insert(TABLE_MANUAL_CURRENCIES, null, values);
|
||||||
|
db.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Currency> getAllCurrenciesFromWatchlist()
|
public List<Currency> getAllCurrenciesFromWatchlist()
|
||||||
|
@ -9,43 +9,11 @@ import android.preference.PreferenceManager;
|
|||||||
|
|
||||||
public class PreferencesManager {
|
public class PreferencesManager {
|
||||||
|
|
||||||
private static int fragmentUpdated = 0;
|
|
||||||
private static final String currencyListFile = "CustomCurrencies";
|
|
||||||
private static final String preferencesFile = "Preferences";
|
|
||||||
private SharedPreferences settingPreferences;
|
private SharedPreferences settingPreferences;
|
||||||
private SharedPreferences currencyList;
|
|
||||||
private SharedPreferences preferencesList;
|
|
||||||
|
|
||||||
public PreferencesManager(android.content.Context context)
|
public PreferencesManager(android.content.Context context)
|
||||||
{
|
{
|
||||||
settingPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
settingPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
currencyList = context.getSharedPreferences(currencyListFile, 0);
|
|
||||||
preferencesList = context.getSharedPreferences(preferencesFile, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDetailOption(boolean isExtended)
|
|
||||||
{
|
|
||||||
SharedPreferences.Editor editor = preferencesList.edit();
|
|
||||||
editor.putBoolean("DetailOption", isExtended);
|
|
||||||
editor.apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getDetailOption()
|
|
||||||
{
|
|
||||||
return preferencesList.getBoolean("DetailOption", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean mustRefreshDefaultCurrency()
|
|
||||||
{
|
|
||||||
fragmentUpdated++;
|
|
||||||
|
|
||||||
if(fragmentUpdated == 3)
|
|
||||||
{
|
|
||||||
disableRefreshDefaultCurrency();
|
|
||||||
fragmentUpdated = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return settingPreferences.getBoolean("refresh_default_currency", false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getMinimumAmount()
|
public float getMinimumAmount()
|
||||||
@ -65,13 +33,6 @@ public class PreferencesManager {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disableRefreshDefaultCurrency()
|
|
||||||
{
|
|
||||||
SharedPreferences.Editor editor = settingPreferences.edit();
|
|
||||||
editor.putBoolean("refresh_default_currency", false);
|
|
||||||
editor.apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultCurrency()
|
public String getDefaultCurrency()
|
||||||
{
|
{
|
||||||
return settingPreferences.getString("default_currency", "USD");
|
return settingPreferences.getString("default_currency", "USD");
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.herbron.moodl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Administrator on 17/06/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface DataNotifierInterface {
|
||||||
|
|
||||||
|
void onTickerListUpdated();
|
||||||
|
|
||||||
|
void onDetailsUpdated();
|
||||||
|
|
||||||
|
void onBalanceDataUpdated();
|
||||||
|
|
||||||
|
void onBalanceError(String error);
|
||||||
|
}
|
@ -4,7 +4,7 @@ import android.support.v4.app.Fragment;
|
|||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||||
|
|
||||||
import com.herbron.moodl.Activities.DetailsActivityFragments.Home;
|
import com.herbron.moodl.Activities.DetailsActivityFragments.Charts;
|
||||||
import com.herbron.moodl.Activities.DetailsActivityFragments.Informations;
|
import com.herbron.moodl.Activities.DetailsActivityFragments.Informations;
|
||||||
import com.herbron.moodl.Activities.DetailsActivityFragments.Transactions;
|
import com.herbron.moodl.Activities.DetailsActivityFragments.Transactions;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ public class DetailsActivityPagerAdapter extends FragmentStatePagerAdapter {
|
|||||||
switch (position)
|
switch (position)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return new Home();
|
return new Charts();
|
||||||
case 1:
|
case 1:
|
||||||
return new Informations();
|
return new Informations();
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -35,7 +35,8 @@ public class FingerprintDialogFragment extends DialogFragment{
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
dismiss();
|
dismiss();
|
||||||
getActivity().finish();
|
getActivity().getFragmentManager().popBackStack();
|
||||||
|
//getActivity().finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ import android.os.CancellationSignal;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
|
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Guitoune on 28/02/2018.
|
* Created by Guitoune on 28/02/2018.
|
||||||
*/
|
*/
|
||||||
@ -39,7 +41,7 @@ public class FingerprintHandler extends FingerprintManager.AuthenticationCallbac
|
|||||||
{
|
{
|
||||||
if(dialogFragment.isVisible())
|
if(dialogFragment.isVisible())
|
||||||
{
|
{
|
||||||
dialogFragment.wrongFingerprint("Error");
|
dialogFragment.wrongFingerprint(context.getString(R.string.error));
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -57,7 +59,7 @@ public class FingerprintHandler extends FingerprintManager.AuthenticationCallbac
|
|||||||
{
|
{
|
||||||
if(dialogFragment.isVisible())
|
if(dialogFragment.isVisible())
|
||||||
{
|
{
|
||||||
dialogFragment.wrongFingerprint("Wrong fingerprint");
|
dialogFragment.wrongFingerprint(context.getString(R.string.wrong_fingerprint));
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
package com.herbron.moodl;
|
|
||||||
|
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.app.FragmentManager;
|
|
||||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
|
||||||
|
|
||||||
import com.herbron.moodl.Activities.HomeActivityFragments.MarketCapitalization;
|
|
||||||
import com.herbron.moodl.Activities.HomeActivityFragments.Summary;
|
|
||||||
import com.herbron.moodl.Activities.HomeActivityFragments.Watchlist;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Tiji on 13/04/2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class HomeActivityPagerAdapter extends FragmentStatePagerAdapter {
|
|
||||||
|
|
||||||
private int numOfTabs;
|
|
||||||
|
|
||||||
public HomeActivityPagerAdapter(FragmentManager fm, int numOfTabs)
|
|
||||||
{
|
|
||||||
super(fm);
|
|
||||||
this.numOfTabs = numOfTabs;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Fragment getItem(int position) {
|
|
||||||
switch (position)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return new Watchlist();
|
|
||||||
case 1:
|
|
||||||
return new Summary();
|
|
||||||
case 2:
|
|
||||||
return new MarketCapitalization();
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount() {
|
|
||||||
return numOfTabs;
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,6 +4,7 @@ import android.content.Context;
|
|||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.herbron.moodl;
|
package com.herbron.moodl;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
import com.herbron.moodl.DataManagers.PreferencesManager;
|
import com.herbron.moodl.DataManagers.PreferencesManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,7 +34,17 @@ public class PlaceholderManager {
|
|||||||
return formattedString;
|
return formattedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getValuePercentageString(String value, String percentage, android.content.Context context)
|
public static String getEditTransactionString(String coinName, Context context)
|
||||||
|
{
|
||||||
|
return context.getResources().getString(R.string.edit_transaction, coinName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getEmitedPercentageString(String percentage, Context context)
|
||||||
|
{
|
||||||
|
return context.getResources().getString(R.string.emitedPlaceholder, percentage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getValuePercentageString(String value, String percentage, Context context)
|
||||||
{
|
{
|
||||||
PreferencesManager preferencesManager = new PreferencesManager(context);
|
PreferencesManager preferencesManager = new PreferencesManager(context);
|
||||||
String formattedString = null;
|
String formattedString = null;
|
||||||
|
15
app/src/main/res/drawable/background_filepath.xml
Normal file
15
app/src/main/res/drawable/background_filepath.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/separationColor"/>
|
||||||
|
|
||||||
|
<corners android:radius="5dp"/>
|
||||||
|
<padding
|
||||||
|
android:left="3dp"
|
||||||
|
android:right="3dp"
|
||||||
|
android:top="3dp"
|
||||||
|
android:bottom="3dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -1,7 +1,7 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
<gradient
|
<gradient
|
||||||
android:type="linear"
|
android:type="linear"
|
||||||
android:startColor="@color/colorPrimary"
|
android:startColor="@color/colorPrimaryDark"
|
||||||
android:endColor="@color/colorPrimaryDark"
|
android:endColor="@color/colorPrimary"
|
||||||
android:angle="0"/>
|
android:angle="0"/>
|
||||||
</shape>
|
</shape>
|
9
app/src/main/res/drawable/ic_panorama_fish_eye_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_panorama_fish_eye_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="@color/colorPrimary"
|
||||||
|
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||||
|
</vector>
|
11
app/src/main/res/drawable/list_background.xml
Normal file
11
app/src/main/res/drawable/list_background.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/summary_background"/>
|
||||||
|
|
||||||
|
<corners android:topLeftRadius="10dp"
|
||||||
|
android:topRightRadius="10dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -5,6 +5,12 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="com.herbron.moodl.Activities.RecordTransactionActivity">
|
tools:context="com.herbron.moodl.Activities.RecordTransactionActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
57
app/src/main/res/layout/dialog_export_data.xml
Normal file
57
app/src/main/res/layout/dialog_export_data.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:focusableInTouchMode="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewFilePath"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/background_filepath"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxBackupManualEntries"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/backup_manual_entries" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxBackupWatchlist"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/backup_watchlist" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxBackupKeys"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/backup_keys" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxEnterPassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/enter_password" />
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/textInputLayoutPassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editTextPassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/password"
|
||||||
|
android:inputType="textPassword"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
81
app/src/main/res/layout/dialog_import_data.xml
Normal file
81
app/src/main/res/layout/dialog_import_data.xml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:focusableInTouchMode="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewFilePath"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/background_filepath"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxRestoreEntries"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/restore_manual_entries"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxWipeManualEntries"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/wipe_manual_entries"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxRestoreWatchlist"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/restore_watchlist"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxWipeWatchlist"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/wipe_watchlist"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxRestoreKeys"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/restore_keys"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxWipeAPIKeys"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/wipe_api_keys"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkboxEnterPassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/enter_password"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/textInputLayoutPassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editTextPassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/password"
|
||||||
|
android:inputType="textPassword"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
278
app/src/main/res/layout/fragment_charts_detailsactivity.xml
Normal file
278
app/src/main/res/layout/fragment_charts_detailsactivity.xml
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/chartsLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatSpinner
|
||||||
|
android:id="@+id/timeIntervalSinner"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/Base.Widget.AppCompat.Spinner"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:text="@string/line_chart"
|
||||||
|
android:id="@+id/lineChartButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:enabled="false"
|
||||||
|
style="@style/Widget.AppCompat.Button.Colored"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:text="@string/candle_stick_chart"
|
||||||
|
android:id="@+id/candleStickChartButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
style="@style/Widget.AppCompat.Button.Colored"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/progressLayoutChart"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.405"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBarChart"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="?android:attr/progressBarStyleLarge"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/circular_progress_bar"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.LineChart
|
||||||
|
android:id="@+id/chartPriceView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:transitionName="chart"/>
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.CandleStickChart
|
||||||
|
android:id="@+id/chartCandleStickView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/timestampHightlight"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_weight="0.33"
|
||||||
|
android:text="@string/backline" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/priceHightlight"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_weight="0.33"
|
||||||
|
android:text="@string/backline" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/volumeHightlight"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_weight="0.33"
|
||||||
|
android:text="@string/backline" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.github.mikephil.charting.charts.BarChart
|
||||||
|
android:id="@+id/chartVolumeView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
android:layout_marginTop="5dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llCharts"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="4dp"
|
||||||
|
android:paddingEnd="4dp"
|
||||||
|
android:baselineAligned="false"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:layout_alignParentBottom="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="0.16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/beginning_price"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtViewPriceStart"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="0.16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/current_price"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtViewPriceNow"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="0.16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/delta"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtViewPercentage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="0.16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/total_volume"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/totalVolume"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="0.16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/highest_price"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/highestPrice"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_weight="0.16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/lowest_price"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lowestPrice"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -1,358 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/chartsLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:text="@string/line_chart"
|
|
||||||
android:id="@+id/lineChartButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:enabled="false"
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:text="@string/candle_stick_chart"
|
|
||||||
android:id="@+id/candleStickChartButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/progressLayoutChart"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.405"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/progressBarChart"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="?android:attr/progressBarStyleLarge"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:background="@drawable/circular_progress_bar"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.github.mikephil.charting.charts.LineChart
|
|
||||||
android:id="@+id/chartPriceView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:transitionName="chart"
|
|
||||||
android:layout_weight="0.5"/>
|
|
||||||
|
|
||||||
<com.github.mikephil.charting.charts.CandleStickChart
|
|
||||||
android:id="@+id/chartCandleStickView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.85"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/timestampHightlight"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:layout_weight="0.33"
|
|
||||||
android:text="@string/backline" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/priceHightlight"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:layout_weight="0.33"
|
|
||||||
android:text="@string/backline" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/volumeHightlight"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:layout_weight="0.33"
|
|
||||||
android:text="@string/backline" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<com.github.mikephil.charting.charts.BarChart
|
|
||||||
android:id="@+id/chartVolumeView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.8"
|
|
||||||
android:layout_marginTop="5dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layoutChartButtons"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.82"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button1h"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button3h"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:enabled="false"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button1d"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button3d"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button1w"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button1m"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:text="@string/button3m"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@string/button6m"/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="11.1"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/button1y"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/llCharts"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.71"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingStart="4dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="0.16">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/beginning_price"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtViewPriceStart"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:layout_weight="0.5"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="0.16">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/current_price"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtViewPriceNow"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:layout_weight="0.5"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="0.16">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/delta"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtViewPercentage"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:layout_weight="0.5"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="0.16">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/total_volume"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/totalVolume"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:layout_weight="0.5" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="0.16">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/highest_price"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/highestPrice"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:layout_weight="0.5" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="0.16">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:text="@string/lowest_price"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lowestPrice"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:autoSizeTextType="uniform"
|
|
||||||
android:layout_weight="0.5" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
@ -4,16 +4,13 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/gradient_background">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
app:layout_collapseMode="pin">
|
android:background="@drawable/gradient_background"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -45,21 +42,20 @@
|
|||||||
|
|
||||||
</android.support.v7.widget.Toolbar>
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/swiperefreshmarketcap"
|
android:id="@+id/swiperefreshmarketcap"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
android:background="@color/summary_background">
|
android:background="@drawable/gradient_background">
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/layoutMarketCap"
|
<LinearLayout android:id="@+id/layoutMarketCap"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="20dp">
|
android:paddingTop="20dp"
|
||||||
|
android:background="@drawable/list_background">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progressBarMarketCap"
|
android:id="@+id/progressBarMarketCap"
|
||||||
|
@ -4,15 +4,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/gradient_background">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="@drawable/gradient_background"
|
||||||
app:layout_collapseMode="pin">
|
app:layout_collapseMode="pin">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@ -45,14 +41,12 @@
|
|||||||
|
|
||||||
</android.support.v7.widget.Toolbar>
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
android:background="@color/summary_background"
|
android:background="@drawable/gradient_background"
|
||||||
android:paddingTop="15dp">
|
android:elevation="0dp">
|
||||||
|
|
||||||
<ListView android:id="@+id/linearLayoutOverview"
|
<ListView android:id="@+id/linearLayoutOverview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -61,7 +55,9 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:dividerHeight="0dp"/>
|
android:dividerHeight="0dp"
|
||||||
|
android:clipChildren="false"
|
||||||
|
android:background="@drawable/list_background"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
@ -5,14 +5,16 @@
|
|||||||
android:id="@+id/coordinatorLayout"
|
android:id="@+id/coordinatorLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="com.herbron.moodl.Activities.HomeActivity">
|
tools:context="com.herbron.moodl.Activities.HomeActivity"
|
||||||
|
android:background="@drawable/gradient_background">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/app_bar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/app_bar_height"
|
android:layout_height="@dimen/app_bar_height"
|
||||||
android:theme="@style/AppTheme.AppBarOverlay"
|
android:theme="@style/AppTheme.AppBarOverlay"
|
||||||
android:background="@drawable/gradient_background">
|
android:background="@drawable/gradient_background"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<android.support.design.widget.CollapsingToolbarLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
android:id="@+id/toolbar_layout"
|
android:id="@+id/toolbar_layout"
|
||||||
@ -22,7 +24,8 @@
|
|||||||
app:toolbarId="@+id/toolbar"
|
app:toolbarId="@+id/toolbar"
|
||||||
app:collapsedTitleGravity="center"
|
app:collapsedTitleGravity="center"
|
||||||
app:expandedTitleGravity="center"
|
app:expandedTitleGravity="center"
|
||||||
app:titleEnabled="true">
|
app:titleEnabled="true"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
@ -70,19 +73,19 @@
|
|||||||
android:id="@+id/swiperefreshsummary"
|
android:id="@+id/swiperefreshsummary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
android:background="@color/summary_background">
|
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:id="@+id/nestedScrollViewLayout"
|
android:id="@+id/nestedScrollViewLayout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/list_background">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="10dp">
|
android:clipChildren="false">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/currencyListLayout"
|
android:id="@+id/currencyListLayout"
|
||||||
@ -96,11 +99,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/button_dashed_background"
|
android:background="@drawable/button_dashed_background"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_margin="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:textColor="@color/separationColor"
|
android:textColor="@color/separationColor"
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"/>
|
style="@style/Widget.AppCompat.Button.Borderless"/>
|
||||||
|
|
||||||
|
@ -4,16 +4,13 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/gradient_background">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
app:layout_collapseMode="pin">
|
android:background="@drawable/gradient_background"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -55,26 +52,25 @@
|
|||||||
|
|
||||||
</android.support.v7.widget.Toolbar>
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.SwipeRefreshLayout
|
<android.support.v4.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/swiperefreshwatchlist"
|
android:id="@+id/swiperefreshwatchlist"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
android:background="@color/summary_background">
|
android:background="@drawable/gradient_background">
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:overScrollMode="never">
|
android:overScrollMode="never"
|
||||||
|
android:background="@drawable/list_background">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="25dp">
|
android:clipChildren="false">
|
||||||
|
|
||||||
<com.jmedeisis.draglinearlayout.DragLinearLayout android:id="@+id/linearLayoutWatchlist"
|
<com.jmedeisis.draglinearlayout.DragLinearLayout android:id="@+id/linearLayoutWatchlist"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -96,11 +92,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/button_dashed_background"
|
android:background="@drawable/button_dashed_background"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_margin="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:textColor="@color/separationColor"
|
android:textColor="@color/separationColor"
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"/>
|
style="@style/Widget.AppCompat.Button.Borderless"/>
|
||||||
|
|
||||||
|
35
app/src/main/res/layout/splash_screen.xml
Normal file
35
app/src/main/res/layout/splash_screen.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:background="@color/colorPrimaryDark">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/animatedViewsLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -61,15 +61,6 @@
|
|||||||
<string name="pref_title_kraken_privatekey">Clé privée</string>
|
<string name="pref_title_kraken_privatekey">Clé privée</string>
|
||||||
<string name="title_watchlist">Liste suivie</string>
|
<string name="title_watchlist">Liste suivie</string>
|
||||||
<string name="title_coin_list">Liste des monnaies</string>
|
<string name="title_coin_list">Liste des monnaies</string>
|
||||||
<string name="button1h">1h</string>
|
|
||||||
<string name="button3h">3h</string>
|
|
||||||
<string name="button1d">1j</string>
|
|
||||||
<string name="button3d">3j</string>
|
|
||||||
<string name="button1w">1S</string>
|
|
||||||
<string name="button1m">1M</string>
|
|
||||||
<string name="button3m">3M</string>
|
|
||||||
<string name="button6m">6M</string>
|
|
||||||
<string name="button1y">1A</string>
|
|
||||||
<string name="timestampPlaceholder">Date\n%1$s</string>
|
<string name="timestampPlaceholder">Date\n%1$s</string>
|
||||||
<string name="volumeDollarPlaceholder">Volume\nUS$%1$s</string>
|
<string name="volumeDollarPlaceholder">Volume\nUS$%1$s</string>
|
||||||
<string name="priceDollarPlaceholder">Prix\nUS$%1$s</string>
|
<string name="priceDollarPlaceholder">Prix\nUS$%1$s</string>
|
||||||
@ -89,4 +80,63 @@
|
|||||||
<string name="field_empty">Ce champ en peut pas être vide</string>
|
<string name="field_empty">Ce champ en peut pas être vide</string>
|
||||||
<string name="field_nan">Ce champ doit être un nombre</string>
|
<string name="field_nan">Ce champ doit être un nombre</string>
|
||||||
<string name="field_negative">Ce champ doit être positif</string>
|
<string name="field_negative">Ce champ doit être positif</string>
|
||||||
|
<string name="pref_title_category_display">Affichage</string>
|
||||||
|
<string name="pref_title_category_data_backup">Sauvegarde des données</string>
|
||||||
|
<string name="pref_title_category_other">Autre</string>
|
||||||
|
<string name="pref_title_version">Version</string>
|
||||||
|
<string name="pref_title_export">Exporter les entrées manuelles</string>
|
||||||
|
<string name="pref_title_import">Importer de nouvelles entrées</string>
|
||||||
|
<string name="pref_title_category_synchronization">Synchronisation</string>
|
||||||
|
<string name="wipe_data">Supprimer les données actuelles</string>
|
||||||
|
<string name="restore_manual_entries">Restaurer les transactions manuelles</string>
|
||||||
|
<string name="restore_keys">Restaurer les clefs d\'API</string>
|
||||||
|
<string name="enter_password">Entrer un mot de passe</string>
|
||||||
|
<string name="password">Mot de passe</string>
|
||||||
|
<string name="title_activity_exchange_settings">Réglages</string>
|
||||||
|
<string name="save">Sauvegarder</string>
|
||||||
|
<string name="cancel">Annuler</string>
|
||||||
|
<string name="confirm">Confirmer</string>
|
||||||
|
<string name="restoreBackup">Restaurer une sauvegarde</string>
|
||||||
|
<string name="pref_header_wallet">Paramètre des portes-monnaies</string>
|
||||||
|
|
||||||
|
<string name="infinity">Infini</string>
|
||||||
|
<string name="others">Autres</string>
|
||||||
|
<string name="market_dominance">Dominance du marché</string>
|
||||||
|
<string name="global">Global</string>
|
||||||
|
<string name="other_coins">Autres monnaies</string>
|
||||||
|
|
||||||
|
<string-array name="time_interval_string_array">
|
||||||
|
<item>1 heure</item>
|
||||||
|
<item>3 heures</item>
|
||||||
|
<item>1 jour</item>
|
||||||
|
<item>3 jours</item>
|
||||||
|
<item>1 semaine</item>
|
||||||
|
<item>1 mois</item>
|
||||||
|
<item>3 mois</item>
|
||||||
|
<item>6 mois</item>
|
||||||
|
<item>1 année</item>
|
||||||
|
</string-array>
|
||||||
|
<string name="emitedPlaceholder">Pourcentage de coin émis : %1$s%%</string>
|
||||||
|
<string name="edit_transaction">Edition d\'une transaction de %1$s</string>
|
||||||
|
<string name="new_transaction">Nouvelle transaction</string>
|
||||||
|
<string name="error_update_data">Erreur lors de l\'actualisation des données</string>
|
||||||
|
<string name="update">Rafraichir</string>
|
||||||
|
<string name="invalid_keys_hitbtc">Erreur de synchronisation avec HitBTC : Clefs invalides</string>
|
||||||
|
<string name="invalid_keys_binance">Erreur de synchronisation avec Binance : Clefs invalides</string>
|
||||||
|
<string name="cannot_resole_host">Impossible de résoudre l\'hôte</string>
|
||||||
|
<string name="unexpected">Erreur inconnue</string>
|
||||||
|
<string name="select_coin">Selectionner une monnaie</string>
|
||||||
|
<string name="already_watchlisr">Monnaie déjà présente dans la liste suivie</string>
|
||||||
|
<string name="create_backup">Créer une sauvegarde</string>
|
||||||
|
<string name="wrong_password">Mauvais mot de passe</string>
|
||||||
|
<string name="error">Erreur</string>
|
||||||
|
<string name="wrong_fingerprint">Mauvaise empreinte digitale</string>
|
||||||
|
<string name="backup_manual_entries">Sauvegarder les entrées manuelles</string>
|
||||||
|
<string name="backup_watchlist">Sauvegarder la liste suivie</string>
|
||||||
|
<string name="backup_keys">Sauvegarder les clefs API</string>
|
||||||
|
<string name="must_be_filled">Ne peut pas être vide</string>
|
||||||
|
<string name="restore_watchlist">Restaurer la liste suivie</string>
|
||||||
|
<string name="wipe_manual_entries">Supprimer les entrées manuelles actuelles</string>
|
||||||
|
<string name="wipe_watchlist">Supprimer la liste suivie actuelle</string>
|
||||||
|
<string name="wipe_api_keys">Supprimer les clefs API actuelles</string>
|
||||||
</resources>
|
</resources>
|
@ -40,4 +40,5 @@
|
|||||||
<color name="transparent_green">#225DBF61</color>
|
<color name="transparent_green">#225DBF61</color>
|
||||||
<color name="blue">#FF689afe</color>
|
<color name="blue">#FF689afe</color>
|
||||||
<color name="transparent_blue">#22689afe</color>
|
<color name="transparent_blue">#22689afe</color>
|
||||||
|
<color name="default_color">#FFAAAAAA</color>
|
||||||
</resources>
|
</resources>
|
@ -12,8 +12,20 @@
|
|||||||
<string name="pref_title_hide_balance">Hide balance</string>
|
<string name="pref_title_hide_balance">Hide balance</string>
|
||||||
|
|
||||||
<!-- Example settings for Data & Sync -->
|
<!-- Example settings for Data & Sync -->
|
||||||
|
<string name="pref_title_category_display">Display</string>
|
||||||
|
<string name="pref_title_category_data_backup">Data backup</string>
|
||||||
|
<string name="pref_title_category_synchronization">Synchronization</string>
|
||||||
|
<string name="pref_title_category_other">Other</string>
|
||||||
|
|
||||||
<string name="pref_title_minimum_amount_displayed">Minimum amount displayed</string>
|
<string name="pref_title_minimum_amount_displayed">Minimum amount displayed</string>
|
||||||
|
|
||||||
|
<string name="pref_title_version">Version</string>
|
||||||
|
|
||||||
|
<string name="ivKey" translatable="false">0123456789MoodlH</string> <!--Must be 16 characters-->
|
||||||
|
|
||||||
|
<string name="pref_title_export">Export manual entries</string>
|
||||||
|
<string name="pref_title_import">Import manual entries</string>
|
||||||
|
|
||||||
<string name="pref_title_default_currency">Default currency</string>
|
<string name="pref_title_default_currency">Default currency</string>
|
||||||
<string-array name="pref_default_currencies_titles">
|
<string-array name="pref_default_currencies_titles">
|
||||||
<item>Dollar (USD)</item>
|
<item>Dollar (USD)</item>
|
||||||
@ -67,7 +79,7 @@
|
|||||||
<string name="trade_loading">Looking for trades…</string>
|
<string name="trade_loading">Looking for trades…</string>
|
||||||
<string name="default_value" translatable="false">--</string>
|
<string name="default_value" translatable="false">--</string>
|
||||||
|
|
||||||
<!--Home activity-->
|
<!--Charts activity-->
|
||||||
<string name="drawer">Drawer</string>
|
<string name="drawer">Drawer</string>
|
||||||
<string name="dominance_percentage">Dominance percentage</string>
|
<string name="dominance_percentage">Dominance percentage</string>
|
||||||
<string name="active_cryptocurrencies">Active cryptocurrencies</string>
|
<string name="active_cryptocurrencies">Active cryptocurrencies</string>
|
||||||
@ -80,6 +92,7 @@
|
|||||||
|
|
||||||
<!--Exchange strings-->
|
<!--Exchange strings-->
|
||||||
<string name="pref_header_exchange">Exchanges settings</string>
|
<string name="pref_header_exchange">Exchanges settings</string>
|
||||||
|
<string name="pref_header_wallet">Wallets settings</string>
|
||||||
<string name="pref_fingerprint" translatable="false">Touch ID</string>
|
<string name="pref_fingerprint" translatable="false">Touch ID</string>
|
||||||
|
|
||||||
<!--HitBTC-->
|
<!--HitBTC-->
|
||||||
@ -126,16 +139,23 @@
|
|||||||
<string name="title_market_cap">Market Capitalization</string>
|
<string name="title_market_cap">Market Capitalization</string>
|
||||||
<string name="title_coin_list">Coin list</string>
|
<string name="title_coin_list">Coin list</string>
|
||||||
|
|
||||||
<!--Chart buttons texts-->
|
<string-array name="time_interval_string_array">
|
||||||
<string name="button1h">1h</string>
|
<item>1 hour</item>
|
||||||
<string name="button3h">3h</string>
|
<item>3 hours</item>
|
||||||
<string name="button1d">1d</string>
|
<item>1 day</item>
|
||||||
<string name="button3d">3d</string>
|
<item>3 days</item>
|
||||||
<string name="button1w">1w</string>
|
<item>1 week</item>
|
||||||
<string name="button1m">1M</string>
|
<item>1 month</item>
|
||||||
<string name="button3m">3M</string>
|
<item>3 months</item>
|
||||||
<string name="button6m">6M</string>
|
<item>6 months</item>
|
||||||
<string name="button1y">1y</string>
|
<item>1 year</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="wipe_options_string_array">
|
||||||
|
<item>Manual entries</item>
|
||||||
|
<item>Watchlist</item>
|
||||||
|
<item>API keys</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<!--Cardview placeholders-->
|
<!--Cardview placeholders-->
|
||||||
<string name="currencySymbolPlaceholder" translatable="false">(%1$s)</string>
|
<string name="currencySymbolPlaceholder" translatable="false">(%1$s)</string>
|
||||||
@ -160,6 +180,7 @@
|
|||||||
|
|
||||||
<!--DetailsActivity placeholders-->
|
<!--DetailsActivity placeholders-->
|
||||||
<string name="timestampPlaceholder">Date\n%1$s</string>
|
<string name="timestampPlaceholder">Date\n%1$s</string>
|
||||||
|
<string name="emitedPlaceholder">Percentage of coin emitted : %1$s%%</string>
|
||||||
<!--Dollar-->
|
<!--Dollar-->
|
||||||
<string name="volumeDollarPlaceholder">Volume\nUS$%1$s</string>
|
<string name="volumeDollarPlaceholder">Volume\nUS$%1$s</string>
|
||||||
<string name="priceDollarPlaceholder">Price\nUS$%1$s</string>
|
<string name="priceDollarPlaceholder">Price\nUS$%1$s</string>
|
||||||
@ -176,6 +197,9 @@
|
|||||||
<string name="fingerprint_dialog_cancel">Cancel</string>
|
<string name="fingerprint_dialog_cancel">Cancel</string>
|
||||||
<string name="fingerprint_dialog_title">Verify your fingerprint to continue</string>
|
<string name="fingerprint_dialog_title">Verify your fingerprint to continue</string>
|
||||||
|
|
||||||
|
<string name="edit_transaction">Edit %1$s transaction</string>
|
||||||
|
<string name="new_transaction">New transaction</string>
|
||||||
|
|
||||||
|
|
||||||
<!--Marketcap placeholders-->
|
<!--Marketcap placeholders-->
|
||||||
<!--Dollar-->
|
<!--Dollar-->
|
||||||
@ -189,5 +213,41 @@
|
|||||||
<string name="field_empty">This field cannot be blank</string>
|
<string name="field_empty">This field cannot be blank</string>
|
||||||
<string name="field_nan">This field must be a number</string>
|
<string name="field_nan">This field must be a number</string>
|
||||||
<string name="field_negative">This field must be positive</string>
|
<string name="field_negative">This field must be positive</string>
|
||||||
|
<string name="wipe_data">Wipe current data</string>
|
||||||
|
<string name="restore_manual_entries">Restore manual entries</string>
|
||||||
|
<string name="restore_keys">Restore API keys</string>
|
||||||
|
<string name="enter_password">Enter password</string>
|
||||||
|
<string name="password">Password</string>
|
||||||
|
<string name="title_activity_exchange_settings">Settings</string>
|
||||||
|
|
||||||
|
<string name="restoreBackup">Restore backup</string>
|
||||||
|
<string name="confirm">Confirm</string>
|
||||||
|
<string name="cancel">Cancel</string>
|
||||||
|
<string name="save">Save</string>
|
||||||
|
<string name="infinity">Infinity</string>
|
||||||
|
<string name="others">Others</string>
|
||||||
|
<string name="market_dominance">Market Cap Dominance</string>
|
||||||
|
<string name="global">Global</string>
|
||||||
|
<string name="other_coins">Other coins</string>
|
||||||
|
<string name="error_update_data">Error while updating data</string>
|
||||||
|
<string name="update">Update</string>
|
||||||
|
<string name="invalid_keys_hitbtc">HitBTC synchronization error : Invalid keys</string>
|
||||||
|
<string name="invalid_keys_binance">Binance synchronization error : Invalid keys</string>
|
||||||
|
<string name="cannot_resole_host">Can\'t resolve host</string>
|
||||||
|
<string name="unexpected">Unexpected error</string>
|
||||||
|
<string name="select_coin">Select a coin</string>
|
||||||
|
<string name="already_watchlisr">Currency already in watchlist</string>
|
||||||
|
<string name="create_backup">Create backup</string>
|
||||||
|
<string name="wrong_password">Wrong password</string>
|
||||||
|
<string name="error">Error</string>
|
||||||
|
<string name="wrong_fingerprint">Wrong fingerprint</string>
|
||||||
|
<string name="backup_manual_entries">Backup manual entries</string>
|
||||||
|
<string name="backup_watchlist">Backup watchlist</string>
|
||||||
|
<string name="backup_keys">Backup API keys</string>
|
||||||
|
<string name="must_be_filled">Cannot be blank</string>
|
||||||
|
<string name="restore_watchlist">Restore watchlist</string>
|
||||||
|
<string name="wipe_manual_entries">Wipe current entries</string>
|
||||||
|
<string name="wipe_watchlist">Wipe current watchlist</string>
|
||||||
|
<string name="wipe_api_keys">Wipe current API keys</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -8,16 +8,12 @@
|
|||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
<item name="swirl_ridgeColor">@color/separationColor</item>
|
<item name="swirl_ridgeColor">@color/separationColor</item>
|
||||||
<item name="swirl_errorColor">@color/decrease</item>
|
<item name="swirl_errorColor">@color/decrease</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<!--<item name="android:windowTranslucentStatus">false</item>
|
<style name="RecordTransactionTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<item name="android:windowTranslucentNavigation">true</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="android:navigationBarColor">@color/transparent</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
<item name="android:actionBarStyle">@style/ThemeActionBar</item>
|
|
||||||
<item name="android:windowActionBarOverlay">true</item>-->
|
|
||||||
<!-- Support library compatibility -->
|
|
||||||
<!--<item name="actionBarStyle">@style/ThemeActionBar</item>
|
|
||||||
<item name="windowActionBarOverlay">true</item>-->
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBar">
|
<style name="AppTheme.NoActionBar">
|
||||||
@ -29,4 +25,10 @@
|
|||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
|
<style name="TimeListView" parent="@android:style/Widget.ListView">
|
||||||
|
<item name="android:cacheColorHint">@android:color/transparent</item>
|
||||||
|
<item name="android:divider">@android:color/transparent</item>
|
||||||
|
<item name="android:dividerHeight">0dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!--<SwitchPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="hide_balance"
|
|
||||||
android:title="@string/pref_title_hide_balance" />-->
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="USD"
|
|
||||||
android:entries="@array/pref_default_currencies_titles"
|
|
||||||
android:entryValues="@array/pref_default_currencies_values"
|
|
||||||
android:key="default_currency"
|
|
||||||
android:negativeButtonText="@null"
|
|
||||||
android:positiveButtonText="@null"
|
|
||||||
android:title="@string/pref_title_default_currency" />
|
|
||||||
|
|
||||||
<EditTextPreference
|
|
||||||
android:defaultValue="0"
|
|
||||||
android:key="minimum_value_displayed"
|
|
||||||
android:negativeButtonText="@null"
|
|
||||||
android:positiveButtonText="@null"
|
|
||||||
android:title="@string/pref_title_minimum_amount_displayed"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="Let blank for none" />
|
|
||||||
|
|
||||||
<PreferenceScreen android:title="Version"
|
|
||||||
android:key="version"/>
|
|
||||||
|
|
||||||
<!-- NOTE: EditTextPreference accepts EditText attributes. -->
|
|
||||||
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
|
|
||||||
<!--<EditTextPreference
|
|
||||||
android:capitalize="words"
|
|
||||||
android:defaultValue="@string/pref_default_display_name"
|
|
||||||
android:inputType="textCapWords"
|
|
||||||
android:key="example_text"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:selectAllOnFocus="true"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:title="@string/pref_title_display_name" />-->
|
|
||||||
|
|
||||||
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
|
|
||||||
dismiss it. -->
|
|
||||||
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
|
|
||||||
<!--<ListPreference
|
|
||||||
android:defaultValue="-1"
|
|
||||||
android:entries="@array/pref_example_list_titles"
|
|
||||||
android:entryValues="@array/pref_example_list_values"
|
|
||||||
android:key="example_list"
|
|
||||||
android:negativeButtonText="@null"
|
|
||||||
android:positiveButtonText="@null"
|
|
||||||
android:title="@string/pref_title_add_friends_to_messages" />-->
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
@ -1,27 +0,0 @@
|
|||||||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!-- These settings headers are only used on tablets. -->
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="com.herbron.moodl.Activities.SettingsActivity$GeneralPreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_info_black_24dp"
|
|
||||||
android:title="@string/pref_header_general" />
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="com.herbron.moodl.Activities.SettingsActivity$ExchangePreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_developer_board_black_24dp"
|
|
||||||
android:title="@string/pref_header_exchange" />
|
|
||||||
|
|
||||||
<!--<header
|
|
||||||
android:fragment="com.nauk.crystalvault.Activities.SettingsActivity$NotificationPreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_notifications_black_24dp"
|
|
||||||
android:title="@string/pref_header_notifications" />
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="com.nauk.crystalvault.Activities.SettingsActivity$DataSyncPreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_sync_black_24dp"
|
|
||||||
android:title="@string/pref_header_data_sync" />-->
|
|
||||||
|
|
||||||
</preference-headers>
|
|
||||||
|
|
||||||
|
|
60
app/src/main/res/xml/pref_main.xml
Normal file
60
app/src/main/res/xml/pref_main.xml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="@string/pref_title_category_display">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="USD"
|
||||||
|
android:entries="@array/pref_default_currencies_titles"
|
||||||
|
android:entryValues="@array/pref_default_currencies_values"
|
||||||
|
android:key="default_currency"
|
||||||
|
android:negativeButtonText="@null"
|
||||||
|
android:positiveButtonText="@null"
|
||||||
|
android:title="@string/pref_title_default_currency" />
|
||||||
|
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:key="minimum_value_displayed"
|
||||||
|
android:negativeButtonText="@null"
|
||||||
|
android:positiveButtonText="@null"
|
||||||
|
android:title="@string/pref_title_minimum_amount_displayed"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:hint="Let blank for none" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="@string/pref_title_category_data_backup">
|
||||||
|
|
||||||
|
<PreferenceScreen android:title="@string/pref_title_export"
|
||||||
|
android:key="export"/>
|
||||||
|
|
||||||
|
<Preference android:title="@string/pref_title_import"
|
||||||
|
android:key="import"/>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="@string/pref_title_category_synchronization">
|
||||||
|
|
||||||
|
<PreferenceScreen
|
||||||
|
android:fragment="com.herbron.moodl.Activities.SettingsActivity$ExchangePreferenceFragment"
|
||||||
|
android:title="@string/pref_header_exchange"
|
||||||
|
android:key="exchange"/>
|
||||||
|
|
||||||
|
<PreferenceScreen
|
||||||
|
android:title="@string/pref_header_wallet"
|
||||||
|
android:enabled="false"/>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:title="@string/pref_title_category_other">
|
||||||
|
|
||||||
|
<PreferenceScreen android:title="@string/pref_title_version"
|
||||||
|
android:key="version"/>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
@ -7,7 +7,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.1.2'
|
classpath 'com.android.tools.build:gradle:3.1.3'
|
||||||
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
@ -20,6 +20,7 @@ allprojects {
|
|||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
|
maven { url "http://dl.bintray.com/lukaville/maven" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,4 +1,4 @@
|
|||||||
#Sun May 13 20:31:16 CEST 2018
|
#Sun Jun 17 03:10:32 CEST 2018
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
BIN
libs/commons-codec-1.11.jar
Normal file
BIN
libs/commons-codec-1.11.jar
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user