Major detail activity fix

- Fix details activity chart loading error
- Fix some non translated strings
This commit is contained in:
Tanguy Herbron 2018-07-17 00:33:29 +02:00
parent 2b165ba2a0
commit aa10defb03
10 changed files with 494 additions and 691 deletions

View File

@ -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);

View File

@ -227,7 +227,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
findPreference("enable_fingerprint").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { findPreference("enable_fingerprint").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object o) { public boolean onPreferenceChange(Preference preference, Object o) {
return false; return false;
} }
}); });
@ -542,8 +542,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
} }
}); });
dialogBuilder.setTitle("Restore backup"); dialogBuilder.setTitle(getString(R.string.restoreBackup));
dialogBuilder.setPositiveButton("Confirm", new DialogInterface.OnClickListener() { dialogBuilder.setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int whichButton) { public void onClick(DialogInterface dialogInterface, int whichButton) {
@ -579,7 +579,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
} }
}); });
dialogBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { dialogBuilder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss(); dialogInterface.dismiss();
@ -594,8 +594,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
}); });
EditTextPreference editTextPreference = (EditTextPreference) findPreference("minimum_value_displayed"); EditTextPreference editTextPreference = (EditTextPreference) findPreference("minimum_value_displayed");
editTextPreference.setPositiveButtonText("Save"); editTextPreference.setPositiveButtonText(getString(R.string.save));
editTextPreference.setNegativeButtonText("Cancel"); editTextPreference.setNegativeButtonText(getString(R.string.cancel));
} }
private boolean checkPermissions() { private boolean checkPermissions() {

View File

@ -93,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);

View File

@ -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");

View File

@ -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:

View 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>

View File

@ -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>

View File

@ -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>
@ -95,4 +86,28 @@
<string name="pref_title_version">Version</string> <string name="pref_title_version">Version</string>
<string name="pref_title_export">Exporter les entrées manuelles</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_import">Importer de nouvelles entrées</string>
<string name="pref_title_category_synchronization">Synchronisation</string>
<string name="conserve_data">Conserver les données</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">Entrerr 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-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>
</resources> </resources>

View File

@ -21,7 +21,7 @@
<string name="pref_title_version">Version</string> <string name="pref_title_version">Version</string>
<string name="ivKey">0123456789MoodlH</string> <!--Must be 16 characters--> <string name="ivKey" translatable="false">0123456789MoodlH</string> <!--Must be 16 characters-->
<string name="pref_title_export">Export manual entries</string> <string name="pref_title_export">Export manual entries</string>
<string name="pref_title_import">Import manual entries</string> <string name="pref_title_import">Import manual entries</string>
@ -79,7 +79,7 @@
<string name="trade_loading">Looking for trades&#8230;</string> <string name="trade_loading">Looking for trades&#8230;</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>
@ -139,16 +139,17 @@
<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>
<!--Cardview placeholders--> <!--Cardview placeholders-->
<string name="currencySymbolPlaceholder" translatable="false">(%1$s)</string> <string name="currencySymbolPlaceholder" translatable="false">(%1$s)</string>
@ -209,71 +210,9 @@
<string name="password">Password</string> <string name="password">Password</string>
<string name="title_activity_exchange_settings">Settings</string> <string name="title_activity_exchange_settings">Settings</string>
<string name="pref_title_social_recommendations">Enable social recommendations</string> <string name="restoreBackup">Restore backup</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact <string name="confirm">Confirm</string>
based on your message history <string name="cancel">Cancel</string>
</string> <string name="save">Save</string>
<string name="pref_title_display_name">Display name</string>
<string name="pref_default_display_name">John Smith</string>
<string name="pref_title_add_friends_to_messages">Add friends to messages</string>
<string-array name="pref_example_list_titles">
<item>Always</item>
<item>When possible</item>
<item>Never</item>
</string-array>
<string-array name="pref_example_list_values">
<item>1</item>
<item>0</item>
<item>-1</item>
</string-array>
<!-- Example settings for Data & Sync -->
<string name="pref_header_data_sync">Data &amp; sync</string>
<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>
<string-array name="list_preference_entries">
<item>Entry 1</item>
<item>Entry 2</item>
<item>Entry 3</item>
</string-array>
<string-array name="list_preference_entry_values">
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="multi_select_list_preference_default_value" />
<string name="pref_title_system_sync_settings">System sync settings</string>
<!-- Example settings for Notifications -->
<string name="pref_header_notifications">Notifications</string>
<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>
</resources> </resources>

View File

@ -29,4 +29,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>