mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 16:53:04 +02:00
- usage of a save icon
- GUI refactored for user settings activity to match with user data entry - tint menu icon color differently
This commit is contained in:
@@ -27,8 +27,7 @@
|
||||
</activity>
|
||||
<activity android:name=".gui.activities.SettingsActivity"/>
|
||||
<activity android:name=".gui.activities.DataEntryActivity"/>
|
||||
<activity android:name=".gui.activities.UserSettingsActivity" android:theme="@android:style/Theme.Holo.Dialog"
|
||||
android:label="@string/label_title_user"/>
|
||||
<activity android:name=".gui.activities.UserSettingsActivity"/>
|
||||
|
||||
<receiver android:name=".core.alarm.ReminderBootReceiver" android:enabled="false">
|
||||
<intent-filter>
|
||||
|
@@ -73,9 +73,7 @@ public class DataEntryActivity extends AppCompatActivity {
|
||||
private Button btnLeft;
|
||||
private Button btnRight;
|
||||
|
||||
private Button btnCancel;
|
||||
private Button btnSave;
|
||||
|
||||
private MenuItem saveButton;
|
||||
private MenuItem editButton;
|
||||
private MenuItem expandButton;
|
||||
private MenuItem deleteButton;
|
||||
@@ -130,29 +128,6 @@ public class DataEntryActivity extends AppCompatActivity {
|
||||
btnLeft = (Button) findViewById(R.id.btnLeft);
|
||||
btnRight = (Button) findViewById(R.id.btnRight);
|
||||
|
||||
btnCancel = (Button) findViewById(R.id.btnCancel);
|
||||
btnSave = (Button) findViewById(R.id.btnSave);
|
||||
|
||||
btnCancel.setOnClickListener(new Button.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
btnSave.setOnClickListener(new Button.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final boolean isEdit = scaleMeasurement.getId() > 0;
|
||||
saveScaleData();
|
||||
if (isEdit) {
|
||||
setViewMode(MeasurementView.MeasurementViewMode.VIEW);
|
||||
}
|
||||
else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnLeft.setVisibility(View.INVISIBLE);
|
||||
btnRight.setVisibility(View.INVISIBLE);
|
||||
|
||||
@@ -206,18 +181,32 @@ public class DataEntryActivity extends AppCompatActivity {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.dataentry_menu, menu);
|
||||
|
||||
// Apply a white tint to all icons in the toolbar
|
||||
// Apply a tint to all icons in the toolbar
|
||||
for (int i = 0; i < menu.size(); ++i) {
|
||||
MenuItem item = menu.getItem(i);
|
||||
final Drawable drawable = item.getIcon();
|
||||
if (drawable == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final Drawable wrapped = DrawableCompat.wrap(drawable.mutate());
|
||||
DrawableCompat.setTint(wrapped, Color.WHITE);
|
||||
|
||||
String menuTitle = item.getTitle().toString();
|
||||
|
||||
if (menuTitle == getResources().getString(R.string.save)) {
|
||||
DrawableCompat.setTint(wrapped, Color.parseColor("#FFFFFF"));
|
||||
} else if (menuTitle == getResources().getString(R.string.edit)) {
|
||||
DrawableCompat.setTint(wrapped, Color.parseColor("#99CC00"));
|
||||
} else if (menuTitle == getResources().getString(R.string.toggle_expand)) {
|
||||
DrawableCompat.setTint(wrapped, Color.parseColor("#FFBB33"));
|
||||
} else if (menuTitle == getResources().getString(R.string.label_delete)) {
|
||||
DrawableCompat.setTint(wrapped, Color.parseColor("#FF4444"));
|
||||
}
|
||||
|
||||
item.setIcon(wrapped);
|
||||
}
|
||||
|
||||
saveButton = menu.findItem(R.id.saveButton);
|
||||
editButton = menu.findItem(R.id.editButton);
|
||||
expandButton = menu.findItem(R.id.expandButton);
|
||||
deleteButton = menu.findItem(R.id.deleteButton);
|
||||
@@ -236,6 +225,17 @@ public class DataEntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.saveButton:
|
||||
final boolean isEdit = scaleMeasurement.getId() > 0;
|
||||
saveScaleData();
|
||||
if (isEdit) {
|
||||
setViewMode(MeasurementView.MeasurementViewMode.VIEW);
|
||||
}
|
||||
else {
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
|
||||
case R.id.expandButton:
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
final boolean expand = !prefs.getBoolean(PREF_EXPAND, true);
|
||||
@@ -328,7 +328,7 @@ public class DataEntryActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
txtDataNr.setText(DateFormat.getDateTimeInstance(
|
||||
DateFormat.LONG, DateFormat.SHORT).format(scaleMeasurement.getDateTime()));
|
||||
DateFormat.LONG, DateFormat.SHORT).format(scaleMeasurement.getDateTime()));
|
||||
}
|
||||
|
||||
private void setViewMode(MeasurementView.MeasurementViewMode viewMode) {
|
||||
@@ -337,39 +337,35 @@ public class DataEntryActivity extends AppCompatActivity {
|
||||
|
||||
switch (viewMode) {
|
||||
case VIEW:
|
||||
saveButton.setVisible(false);
|
||||
editButton.setVisible(true);
|
||||
expandButton.setVisible(true);
|
||||
deleteButton.setVisible(true);
|
||||
|
||||
btnCancel.setVisibility(View.GONE);
|
||||
btnSave.setVisibility(View.GONE);
|
||||
|
||||
btnLeft.setVisibility(View.VISIBLE);
|
||||
btnRight.setVisibility(View.VISIBLE);
|
||||
btnLeft.setEnabled(true);
|
||||
btnRight.setEnabled(true);
|
||||
|
||||
dateTimeVisibility = View.GONE;
|
||||
break;
|
||||
case EDIT:
|
||||
saveButton.setVisible(true);
|
||||
editButton.setVisible(false);
|
||||
expandButton.setVisible(true);
|
||||
deleteButton.setVisible(true);
|
||||
|
||||
btnCancel.setVisibility(View.VISIBLE);
|
||||
btnSave.setVisibility(View.VISIBLE);
|
||||
btnSave.setText(R.string.label_ok);
|
||||
|
||||
btnLeft.setVisibility(View.GONE);
|
||||
btnRight.setVisibility(View.GONE);
|
||||
btnLeft.setVisibility(View.VISIBLE);
|
||||
btnRight.setVisibility(View.VISIBLE);
|
||||
btnLeft.setEnabled(false);
|
||||
btnRight.setEnabled(false);
|
||||
break;
|
||||
case ADD:
|
||||
saveButton.setVisible(true);
|
||||
editButton.setVisible(false);
|
||||
expandButton.setVisible(false);
|
||||
deleteButton.setVisible(false);
|
||||
|
||||
btnCancel.setVisibility(View.VISIBLE);
|
||||
btnSave.setVisibility(View.VISIBLE);
|
||||
btnSave.setText(R.string.label_add);
|
||||
|
||||
btnLeft.setVisibility(View.GONE);
|
||||
btnRight.setVisibility(View.GONE);
|
||||
break;
|
||||
|
@@ -15,15 +15,21 @@
|
||||
*/
|
||||
package com.health.openscale.gui.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioGroup;
|
||||
@@ -39,7 +45,7 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class UserSettingsActivity extends Activity {
|
||||
public class UserSettingsActivity extends AppCompatActivity {
|
||||
public static String EXTRA_ID = "id";
|
||||
public static String EXTRA_MODE = "mode";
|
||||
|
||||
@@ -58,9 +64,8 @@ public class UserSettingsActivity extends Activity {
|
||||
private RadioGroup radioScaleUnit;
|
||||
private RadioGroup radioGender;
|
||||
|
||||
private Button btnOk;
|
||||
private Button btnCancel;
|
||||
private Button btnDelete;
|
||||
private MenuItem saveButton;
|
||||
private MenuItem deleteButton;
|
||||
|
||||
private DateFormat dateFormat = DateFormat.getDateInstance();
|
||||
|
||||
@@ -72,6 +77,12 @@ public class UserSettingsActivity extends Activity {
|
||||
setContentView(R.layout.activity_usersettings);
|
||||
context = this;
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.userEntryToolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setTitle(getResources().getString(R.string.label_title_user));
|
||||
|
||||
txtUserName = (EditText) findViewById(R.id.txtUserName);
|
||||
txtBodyHeight = (EditText) findViewById(R.id.txtBodyHeight);
|
||||
radioScaleUnit = (RadioGroup) findViewById(R.id.groupScaleUnit);
|
||||
@@ -82,14 +93,6 @@ public class UserSettingsActivity extends Activity {
|
||||
txtBirthday = (EditText) findViewById(R.id.txtBirthday);
|
||||
txtGoalDate = (EditText) findViewById(R.id.txtGoalDate);
|
||||
|
||||
btnDelete = (Button) findViewById(R.id.btnDelete);
|
||||
btnOk = (Button)findViewById(R.id.btnOk);
|
||||
btnCancel = (Button)findViewById(R.id.btnCancel);
|
||||
|
||||
btnOk.setOnClickListener(new onClickListenerOk());
|
||||
btnCancel.setOnClickListener(new onClickListenerCancel());
|
||||
btnDelete.setOnClickListener(new onClickListenerDelete());
|
||||
|
||||
Calendar birthdayCal = Calendar.getInstance();
|
||||
birthdayCal.setTime(birthday);
|
||||
birthdayCal.add(Calendar.YEAR, -20);
|
||||
@@ -126,15 +129,72 @@ public class UserSettingsActivity extends Activity {
|
||||
datePicker.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.userentry_menu, menu);
|
||||
|
||||
// Apply a tint to all icons in the toolbar
|
||||
for (int i = 0; i < menu.size(); ++i) {
|
||||
MenuItem item = menu.getItem(i);
|
||||
final Drawable drawable = item.getIcon();
|
||||
if (drawable == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final Drawable wrapped = DrawableCompat.wrap(drawable.mutate());
|
||||
|
||||
String menuTitle = item.getTitle().toString();
|
||||
|
||||
if (menuTitle == getResources().getString(R.string.save)) {
|
||||
DrawableCompat.setTint(wrapped, Color.parseColor("#FFFFFF"));
|
||||
} else if (menuTitle == getResources().getString(R.string.label_delete)) {
|
||||
DrawableCompat.setTint(wrapped, Color.parseColor("#FF4444"));
|
||||
}
|
||||
|
||||
item.setIcon(wrapped);
|
||||
}
|
||||
|
||||
saveButton = menu.findItem(R.id.saveButton);
|
||||
deleteButton = menu.findItem(R.id.deleteButton);
|
||||
|
||||
if (getIntent().getExtras().getInt(EXTRA_MODE) == EDIT_USER_REQUEST) {
|
||||
editMode();
|
||||
deleteButton.setVisible(true);
|
||||
}
|
||||
else {
|
||||
btnOk.setText(getResources().getString(R.string.label_add));
|
||||
btnDelete.setVisibility(View.GONE);
|
||||
deleteButton.setVisible(false);
|
||||
}
|
||||
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.saveButton:
|
||||
if (saveUserData()) {
|
||||
Intent returnIntent = new Intent();
|
||||
setResult(RESULT_OK, returnIntent);
|
||||
|
||||
finish();
|
||||
}
|
||||
return true;
|
||||
|
||||
case R.id.deleteButton:
|
||||
deleteUser();
|
||||
return true;
|
||||
|
||||
// Override the default behaviour in order to return to the correct fragment
|
||||
// (e.g. the table view) and not always go to the overview.
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void editMode()
|
||||
@@ -145,6 +205,8 @@ public class UserSettingsActivity extends Activity {
|
||||
|
||||
ScaleUser scaleUser = openScale.getScaleUser(id);
|
||||
|
||||
getSupportActionBar().setTitle(scaleUser.getUserName());
|
||||
|
||||
birthday = scaleUser.getBirthday();
|
||||
goal_date = scaleUser.getGoalDate();
|
||||
|
||||
@@ -232,129 +294,112 @@ public class UserSettingsActivity extends Activity {
|
||||
}
|
||||
};
|
||||
|
||||
private class onClickListenerDelete implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder deleteAllDialog = new AlertDialog.Builder(v.getContext());
|
||||
private void deleteUser() {
|
||||
AlertDialog.Builder deleteAllDialog = new AlertDialog.Builder(context);
|
||||
|
||||
deleteAllDialog.setMessage(getResources().getString(R.string.question_really_delete_user));
|
||||
deleteAllDialog.setMessage(getResources().getString(R.string.question_really_delete_user));
|
||||
|
||||
deleteAllDialog.setPositiveButton(getResources().getString(R.string.label_yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
int userId = getIntent().getExtras().getInt(EXTRA_ID);
|
||||
deleteAllDialog.setPositiveButton(getResources().getString(R.string.label_yes), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
int userId = getIntent().getExtras().getInt(EXTRA_ID);
|
||||
|
||||
OpenScale openScale = OpenScale.getInstance(getApplicationContext());
|
||||
openScale.clearScaleData(userId);
|
||||
openScale.deleteScaleUser(userId);
|
||||
OpenScale openScale = OpenScale.getInstance(getApplicationContext());
|
||||
openScale.clearScaleData(userId);
|
||||
openScale.deleteScaleUser(userId);
|
||||
|
||||
List<ScaleUser> scaleUser = openScale.getScaleUserList();
|
||||
List<ScaleUser> scaleUser = openScale.getScaleUserList();
|
||||
|
||||
int lastUserId = -1;
|
||||
int lastUserId = -1;
|
||||
|
||||
if (!scaleUser.isEmpty()) {
|
||||
lastUserId = scaleUser.get(0).getId();
|
||||
}
|
||||
|
||||
openScale.selectScaleUser(lastUserId);
|
||||
openScale.updateScaleData();
|
||||
|
||||
Intent returnIntent = new Intent();
|
||||
setResult(RESULT_OK, returnIntent);
|
||||
|
||||
finish();
|
||||
if (!scaleUser.isEmpty()) {
|
||||
lastUserId = scaleUser.get(0).getId();
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.setNegativeButton(getResources().getString(R.string.label_no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
openScale.selectScaleUser(lastUserId);
|
||||
openScale.updateScaleData();
|
||||
|
||||
deleteAllDialog.show();
|
||||
}
|
||||
}
|
||||
Intent returnIntent = new Intent();
|
||||
setResult(RESULT_OK, returnIntent);
|
||||
|
||||
private class onClickListenerOk implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
if (validateInput()) {
|
||||
OpenScale openScale = OpenScale.getInstance(getApplicationContext());
|
||||
|
||||
String name = txtUserName.getText().toString();
|
||||
int body_height = Integer.valueOf(txtBodyHeight.getText().toString());
|
||||
int checkedRadioButtonId = radioScaleUnit.getCheckedRadioButtonId();
|
||||
int checkedGenderId = radioGender.getCheckedRadioButtonId();
|
||||
float initial_weight = Float.valueOf(txtInitialWeight.getText().toString());
|
||||
float goal_weight = Float.valueOf(txtGoalWeight.getText().toString());
|
||||
|
||||
Converters.WeightUnit scale_unit = Converters.WeightUnit.KG;
|
||||
|
||||
switch (checkedRadioButtonId) {
|
||||
case R.id.btnRadioKG:
|
||||
scale_unit = Converters.WeightUnit.KG;
|
||||
break;
|
||||
case R.id.btnRadioLB:
|
||||
scale_unit = Converters.WeightUnit.LB;
|
||||
break;
|
||||
case R.id.btnRadioST:
|
||||
scale_unit = Converters.WeightUnit.ST;
|
||||
break;
|
||||
}
|
||||
|
||||
Converters.Gender gender = Converters.Gender.MALE;
|
||||
|
||||
switch (checkedGenderId) {
|
||||
case R.id.btnRadioMale:
|
||||
gender = Converters.Gender.MALE;
|
||||
break;
|
||||
case R.id.btnRadioWoman:
|
||||
gender = Converters.Gender.FEMALE;
|
||||
break;
|
||||
}
|
||||
|
||||
final ScaleUser scaleUser = new ScaleUser();
|
||||
|
||||
scaleUser.setUserName(name);
|
||||
scaleUser.setBirthday(birthday);
|
||||
scaleUser.setBodyHeight(body_height);
|
||||
scaleUser.setScaleUnit(scale_unit);
|
||||
scaleUser.setGender(gender);
|
||||
scaleUser.setConvertedInitialWeight(initial_weight);
|
||||
scaleUser.setGoalWeight(goal_weight);
|
||||
scaleUser.setGoalDate(goal_date);
|
||||
|
||||
if (getIntent().getExtras().getInt(EXTRA_MODE) == EDIT_USER_REQUEST) {
|
||||
int id = getIntent().getExtras().getInt(EXTRA_ID);
|
||||
scaleUser.setId(id);
|
||||
openScale.updateScaleUser(scaleUser);
|
||||
} else {
|
||||
int id = openScale.addScaleUser(scaleUser);
|
||||
scaleUser.setId(id);
|
||||
}
|
||||
|
||||
openScale.selectScaleUser(scaleUser.getId());
|
||||
openScale.updateScaleData();
|
||||
|
||||
Intent returnIntent = new Intent();
|
||||
setResult(RESULT_OK, returnIntent);
|
||||
|
||||
finish();
|
||||
}
|
||||
} catch (NumberFormatException ex) {
|
||||
Toast.makeText(context, getResources().getString(R.string.error_value_range) + "(" + ex.getMessage() + ")", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.setNegativeButton(getResources().getString(R.string.label_no), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
deleteAllDialog.show();
|
||||
}
|
||||
|
||||
private class onClickListenerCancel implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent returnIntent = new Intent();
|
||||
setResult(RESULT_CANCELED, returnIntent);
|
||||
private boolean saveUserData() {
|
||||
try {
|
||||
if (validateInput()) {
|
||||
OpenScale openScale = OpenScale.getInstance(getApplicationContext());
|
||||
|
||||
finish();
|
||||
String name = txtUserName.getText().toString();
|
||||
int body_height = Integer.valueOf(txtBodyHeight.getText().toString());
|
||||
int checkedRadioButtonId = radioScaleUnit.getCheckedRadioButtonId();
|
||||
int checkedGenderId = radioGender.getCheckedRadioButtonId();
|
||||
float initial_weight = Float.valueOf(txtInitialWeight.getText().toString());
|
||||
float goal_weight = Float.valueOf(txtGoalWeight.getText().toString());
|
||||
|
||||
Converters.WeightUnit scale_unit = Converters.WeightUnit.KG;
|
||||
|
||||
switch (checkedRadioButtonId) {
|
||||
case R.id.btnRadioKG:
|
||||
scale_unit = Converters.WeightUnit.KG;
|
||||
break;
|
||||
case R.id.btnRadioLB:
|
||||
scale_unit = Converters.WeightUnit.LB;
|
||||
break;
|
||||
case R.id.btnRadioST:
|
||||
scale_unit = Converters.WeightUnit.ST;
|
||||
break;
|
||||
}
|
||||
|
||||
Converters.Gender gender = Converters.Gender.MALE;
|
||||
|
||||
switch (checkedGenderId) {
|
||||
case R.id.btnRadioMale:
|
||||
gender = Converters.Gender.MALE;
|
||||
break;
|
||||
case R.id.btnRadioWoman:
|
||||
gender = Converters.Gender.FEMALE;
|
||||
break;
|
||||
}
|
||||
|
||||
final ScaleUser scaleUser = new ScaleUser();
|
||||
|
||||
scaleUser.setUserName(name);
|
||||
scaleUser.setBirthday(birthday);
|
||||
scaleUser.setBodyHeight(body_height);
|
||||
scaleUser.setScaleUnit(scale_unit);
|
||||
scaleUser.setGender(gender);
|
||||
scaleUser.setConvertedInitialWeight(initial_weight);
|
||||
scaleUser.setGoalWeight(goal_weight);
|
||||
scaleUser.setGoalDate(goal_date);
|
||||
|
||||
if (getIntent().getExtras().getInt(EXTRA_MODE) == EDIT_USER_REQUEST) {
|
||||
int id = getIntent().getExtras().getInt(EXTRA_ID);
|
||||
scaleUser.setId(id);
|
||||
openScale.updateScaleUser(scaleUser);
|
||||
} else {
|
||||
int id = openScale.addScaleUser(scaleUser);
|
||||
scaleUser.setId(id);
|
||||
}
|
||||
|
||||
openScale.selectScaleUser(scaleUser.getId());
|
||||
openScale.updateScaleData();
|
||||
|
||||
return true;
|
||||
}
|
||||
} catch (NumberFormatException ex) {
|
||||
Toast.makeText(context, getResources().getString(R.string.error_value_range) + "(" + ex.getMessage() + ")", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
BIN
android_app/app/src/main/res/drawable-hdpi/ic_save.png
Normal file
BIN
android_app/app/src/main/res/drawable-hdpi/ic_save.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 545 B |
BIN
android_app/app/src/main/res/drawable-ldpi/ic_save.png
Normal file
BIN
android_app/app/src/main/res/drawable-ldpi/ic_save.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 331 B |
BIN
android_app/app/src/main/res/drawable-mdpi/ic_save.png
Normal file
BIN
android_app/app/src/main/res/drawable-mdpi/ic_save.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 380 B |
BIN
android_app/app/src/main/res/drawable-xhdpi/ic_save.png
Normal file
BIN
android_app/app/src/main/res/drawable-xhdpi/ic_save.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 613 B |
BIN
android_app/app/src/main/res/drawable-xxhdpi/ic_save.png
Normal file
BIN
android_app/app/src/main/res/drawable-xxhdpi/ic_save.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 816 B |
BIN
android_app/app/src/main/res/drawable-xxxhdpi/ic_save.png
Normal file
BIN
android_app/app/src/main/res/drawable-xxxhdpi/ic_save.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1019 B |
@@ -68,33 +68,4 @@
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_cancel"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_add"
|
||||
android:textColor="@android:color/white" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@@ -1,9 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/userEntryToolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -226,39 +235,7 @@
|
||||
android:inputType="date" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
<Button
|
||||
android:id="@+id/btnCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_cancel"
|
||||
android:layout_marginRight="10dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDelete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_delete"
|
||||
android:layout_marginRight="10dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_ok" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
@@ -3,19 +3,30 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/editButton"
|
||||
android:title="@string/edit"
|
||||
android:icon="@drawable/ic_editable"
|
||||
android:id="@+id/deleteButton"
|
||||
android:title="@string/label_delete"
|
||||
android:icon="@drawable/ic_delete"
|
||||
android:iconTint="#FF4444"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/expandButton"
|
||||
android:title="@string/toggle_expand"
|
||||
android:icon="@drawable/ic_expand"
|
||||
android:iconTint="#FFBB33"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/deleteButton"
|
||||
android:title="@string/label_delete"
|
||||
android:icon="@drawable/ic_delete"
|
||||
android:id="@+id/saveButton"
|
||||
android:title="@string/save"
|
||||
android:icon="@drawable/ic_save"
|
||||
android:iconTint="#FFFFFF"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/editButton"
|
||||
android:title="@string/edit"
|
||||
android:icon="@drawable/ic_editable"
|
||||
android:iconTint="#99CC00"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
19
android_app/app/src/main/res/menu/userentry_menu.xml
Normal file
19
android_app/app/src/main/res/menu/userentry_menu.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/deleteButton"
|
||||
android:title="@string/label_delete"
|
||||
android:icon="@drawable/ic_delete"
|
||||
android:iconTint="#FF4444"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/saveButton"
|
||||
android:title="@string/save"
|
||||
android:icon="@drawable/ic_save"
|
||||
android:iconTint="#FFFFFF"
|
||||
app:showAsAction="always" />
|
||||
|
||||
</menu>
|
@@ -214,5 +214,6 @@
|
||||
<string name="customactivityoncrash_error_activity_error_details_clipboard_label">Error information</string>
|
||||
<string name="toggle_expand">Toggle expand</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="save">Save</string>
|
||||
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user