1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-01-17 06:08:30 +01:00

supporting multiple screen sizes and densities for all used icons

This commit is contained in:
OliE 2017-08-10 20:45:20 +02:00
parent 3c4d39dd2b
commit 92a238a550
237 changed files with 95 additions and 51 deletions

45
CREDITS Normal file
View File

@ -0,0 +1,45 @@
openScale uses open source components. You can find the source code of their open source projects along with license information below.
I acknowledge and I am grateful to these developers for their contributions to open source.
Project: HelloCharts
Copyright 2014 Leszek Wach
Apache License, Version 2.0
License: https://www.apache.org/licenses/LICENSE-2.0
Website: https://github.com/lecho/hellocharts-android
Project: Low-Power
Copyright 2016 Lim Phang Moh
Creative Commons Attribution-ShareAlike 3.0
Licnese: https://creativecommons.org/licenses/by-sa/3.0
Website: https://github.com/rocketscream/Low-Power
Project: DS3232RTC
Copyright 2013 Jack Christensen
Attribution-ShareAlike 4.0 International
License: https://creativecommons.org/licenses/by-sa/4.0/
Website: https://github.com/JChristensen/DS3232RTC
Project: I2C_EEPROM & RunningMedian
Copyright 2015 Rob Tillaart
License: Released to the public domain
Website: https://github.com/RobTillaart/Arduino
Project: Arduino Time Library
Copyright 2009-2014 Michael Margolis
GNU Lesser General Public License 2.1 or any later version
License: https://www.gnu.org/licenses/
Website: https://github.com/PaulStoffregen/Time
Used icons are by flaticon.com (http://www.flaticon.com)
Attribution 3.0 Unported (CC BY 3.0)
License: http://creativecommons.org/licenses/by/3.0/
* Icomoon (https://www.flaticon.com/authors/icomoon)
* Google (https://www.flaticon.com/authors/google)
* Robin Kylander (https://www.flaticon.com/authors/robin-kylander)
* Freepik (http://www.freepik.com)
* Scott de Jonge (https://www.flaticon.com/authors/scott-de-jonge)
* Cursor Creative (https://www.flaticon.com/authors/cursor-creative)
* Madebyoliver (https://www.flaticon.com/authors/madebyoliver)
Contributors to openScale are listed on:
https://github.com/oliexdev/openScale/graphs/contributors

View File

@ -12,7 +12,7 @@
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:icon="@drawable/ic_launcher_openscale"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity

View File

@ -158,7 +158,7 @@ public class AlarmHandler
PendingIntent.getActivity(context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);
Notification notification = mBuilder.setSmallIcon(R.drawable.ic_launcher)
Notification notification = mBuilder.setSmallIcon(R.drawable.ic_launcher_openscale)
.setContentTitle(context.getString(R.string.app_name))
.setContentText(notifyText)
.setAutoCancel(true)

View File

@ -65,7 +65,7 @@ public class MainActivity extends ActionBarActivity implements
private SectionsPagerAdapter mSectionsPagerAdapter;
private static boolean firstAppStart = true;
private static int bluetoothStatusIcon = R.drawable.bluetooth_disabled;
private static int bluetoothStatusIcon = R.drawable.ic_bluetooth_disabled;
private static MenuItem bluetoothStatus;
/**
@ -86,7 +86,7 @@ public class MainActivity extends ActionBarActivity implements
final ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setLogo(R.drawable.ic_launcher);
actionBar.setLogo(R.drawable.ic_launcher_openscale);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
@ -173,7 +173,7 @@ public class MainActivity extends ActionBarActivity implements
BluetoothAdapter btAdapter = bluetoothManager.getAdapter();
if (btAdapter == null || !btAdapter.isEnabled()) {
setBluetoothStatusIcon(R.drawable.bluetooth_disabled);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_disabled);
Toast.makeText(getApplicationContext(), "Bluetooth " + getResources().getString(R.string.info_is_not_enable), Toast.LENGTH_SHORT).show();
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
@ -189,14 +189,14 @@ public class MainActivity extends ActionBarActivity implements
// Check if Bluetooth 4.x is available
if (BluetoothCommunication.getBtDevice(getApplicationContext(), deviceType).isBLE()) {
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
setBluetoothStatusIcon(R.drawable.bluetooth_disabled);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_disabled);
Toast.makeText(getApplicationContext(), "Bluetooth 4.x " + getResources().getString(R.string.info_is_not_available), Toast.LENGTH_SHORT).show();
return;
}
}
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_try_connection) + " " + deviceName, Toast.LENGTH_SHORT).show();
setBluetoothStatusIcon(R.drawable.bluetooth_searching);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_searching);
OpenScale.getInstance(getApplicationContext()).stopSearchingForBluetooth();
OpenScale.getInstance(getApplicationContext()).startSearchingForBluetooth(deviceType, deviceName, callbackBtHandler);
@ -210,7 +210,7 @@ public class MainActivity extends ActionBarActivity implements
switch (btStatusCode) {
case BT_RETRIEVE_SCALE_DATA:
setBluetoothStatusIcon(R.drawable.bluetooth_connection_success);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_success);
ScaleData scaleBtData = (ScaleData) msg.obj;
scaleBtData.setConvertedWeight(scaleBtData.getWeight(), OpenScale.getInstance(getApplicationContext()).getSelectedScaleUser().scale_unit);
@ -218,27 +218,27 @@ public class MainActivity extends ActionBarActivity implements
OpenScale.getInstance(getApplicationContext()).addScaleData(scaleBtData);
break;
case BT_INIT_PROCESS:
setBluetoothStatusIcon(R.drawable.bluetooth_connection_success);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_success);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_init), Toast.LENGTH_SHORT).show();
Log.d("OpenScale", "Bluetooth initializing");
break;
case BT_CONNECTION_LOST:
setBluetoothStatusIcon(R.drawable.bluetooth_connection_lost);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_lost);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_connection_lost), Toast.LENGTH_SHORT).show();
Log.d("OpenScale", "Bluetooth connection lost");
break;
case BT_NO_DEVICE_FOUND:
setBluetoothStatusIcon(R.drawable.bluetooth_connection_lost);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_lost);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_no_device), Toast.LENGTH_SHORT).show();
Log.d("OpenScale", "No Bluetooth device found");
break;
case BT_CONNECTION_ESTABLISHED:
setBluetoothStatusIcon(R.drawable.bluetooth_connection_success);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_success);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_connection_successful), Toast.LENGTH_SHORT).show();
Log.d("OpenScale", "Bluetooth connection successful established");
break;
case BT_UNEXPECTED_ERROR:
setBluetoothStatusIcon(R.drawable.bluetooth_connection_lost);
setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_lost);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.info_bluetooth_connection_error) + ": " + msg.obj, Toast.LENGTH_SHORT).show();
Log.e("OpenScale", "Bluetooth unexpected error: " + msg.obj);
break;

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class BMIMeasurementView extends MeasurementView {
public BMIMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_bmi), ContextCompat.getDrawable(context, R.drawable.bmi));
super(context, context.getResources().getString(R.string.label_bmi), ContextCompat.getDrawable(context, R.drawable.ic_bmi));
}
@Override

View File

@ -29,7 +29,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class CommentMeasurementView extends MeasurementView {
public CommentMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_comment), ContextCompat.getDrawable(context, R.drawable.comment));
super(context, context.getResources().getString(R.string.label_comment), ContextCompat.getDrawable(context, R.drawable.ic_comment));
}
@Override

View File

@ -34,7 +34,7 @@ public class DateMeasurementView extends MeasurementView {
private SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
public DateMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_date), ContextCompat.getDrawable(context, R.drawable.lastmonth));
super(context, context.getResources().getString(R.string.label_date), ContextCompat.getDrawable(context, R.drawable.ic_lastmonth));
}
private DatePickerDialog.OnDateSetListener datePickerListener = new DatePickerDialog.OnDateSetListener() {

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class FatMeasurementView extends MeasurementView {
public FatMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_fat), ContextCompat.getDrawable(context, R.drawable.fat));
super(context, context.getResources().getString(R.string.label_fat), ContextCompat.getDrawable(context, R.drawable.ic_fat));
}
@Override

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class HipMeasurementView extends MeasurementView {
public HipMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_hip), ContextCompat.getDrawable(context, R.drawable.hip));
super(context, context.getResources().getString(R.string.label_hip), ContextCompat.getDrawable(context, R.drawable.ic_hip));
}
@Override

View File

@ -107,8 +107,8 @@ public abstract class MeasurementView extends TableLayout {
addView(measurementRow);
addView(evaluatorRow);
iconView.getLayoutParams().height = pxImageDp(30);
iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
iconView.setPadding(20,0,20,0);
nameView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
nameView.setTextColor(Color.BLACK);
@ -121,8 +121,7 @@ public abstract class MeasurementView extends TableLayout {
valueView.setPadding(0,0,20,0);
valueView.setLayoutParams(new TableRow.LayoutParams(0, LayoutParams.MATCH_PARENT, 0.29f));
editModeView.getLayoutParams().height = pxImageDp(20);
editModeView.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.editable));
editModeView.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_editable));
editModeView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
editModeView.setVisibility(View.GONE);
@ -183,7 +182,7 @@ public abstract class MeasurementView extends TableLayout {
editModeView.setVisibility(View.VISIBLE);
if (!isEditable()) {
editModeView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.noteditable));
editModeView.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_noteeditable));
}
indicatorView.setVisibility(View.GONE);

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class MuscleMeasurementView extends MeasurementView {
public MuscleMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_muscle), ContextCompat.getDrawable(context, R.drawable.muscle));
super(context, context.getResources().getString(R.string.label_muscle), ContextCompat.getDrawable(context, R.drawable.ic_muscle));
}
@Override

View File

@ -34,7 +34,7 @@ public class TimeMeasurementView extends MeasurementView {
private SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm");
public TimeMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_time), ContextCompat.getDrawable(context, R.drawable.daysleft));
super(context, context.getResources().getString(R.string.label_time), ContextCompat.getDrawable(context, R.drawable.ic_daysleft));
}
private TimePickerDialog.OnTimeSetListener timePickerListener = new TimePickerDialog.OnTimeSetListener() {

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class WHRMeasurementView extends MeasurementView {
public WHRMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_whr), ContextCompat.getDrawable(context, R.drawable.whr));
super(context, context.getResources().getString(R.string.label_whr), ContextCompat.getDrawable(context, R.drawable.ic_whr));
}
@Override

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class WHtRMeasurementView extends MeasurementView {
public WHtRMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_whtr), ContextCompat.getDrawable(context, R.drawable.whtr));
super(context, context.getResources().getString(R.string.label_whtr), ContextCompat.getDrawable(context, R.drawable.ic_whtr));
}
@Override

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class WaistMeasurementView extends MeasurementView {
public WaistMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_waist), ContextCompat.getDrawable(context, R.drawable.waist));
super(context, context.getResources().getString(R.string.label_waist), ContextCompat.getDrawable(context, R.drawable.ic_waist));
}
@Override

View File

@ -27,7 +27,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class WaterMeasurementView extends MeasurementView {
public WaterMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_water), ContextCompat.getDrawable(context, R.drawable.water));
super(context, context.getResources().getString(R.string.label_water), ContextCompat.getDrawable(context, R.drawable.ic_water));
}
@Override

View File

@ -28,7 +28,7 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
public class WeightMeasurementView extends MeasurementView {
public WeightMeasurementView(Context context) {
super(context, context.getResources().getString(R.string.label_weight), ContextCompat.getDrawable(context, R.drawable.weight));
super(context, context.getResources().getString(R.string.label_weight), ContextCompat.getDrawable(context, R.drawable.ic_weight));
}
@Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Some files were not shown because too many files have changed in this diff Show More