mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-22 16:23:09 +02:00
removed buttons for date/time set.
This commit is contained in:
@@ -24,7 +24,6 @@ import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TableRow;
|
||||
@@ -68,8 +67,6 @@ public class NewEntryActivity extends Activity {
|
||||
txtDate = (EditText) findViewById(R.id.txtDate);
|
||||
txtTime = (EditText) findViewById(R.id.txtTime);
|
||||
txtComment = (EditText) findViewById(R.id.txtComment);
|
||||
Button btnDateSet = (Button) findViewById(R.id.btnDateSet);
|
||||
Button btnTimeSet = (Button) findViewById(R.id.btnTimeSet);
|
||||
|
||||
findViewById(R.id.btnAdd).setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View view) {
|
||||
@@ -82,23 +79,29 @@ public class NewEntryActivity extends Activity {
|
||||
btnOnClickCancel();
|
||||
}
|
||||
});
|
||||
|
||||
btnDateSet.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
DatePickerDialog datePicker = new DatePickerDialog(context, datePickerListener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
|
||||
datePicker.show();
|
||||
}
|
||||
});
|
||||
|
||||
btnTimeSet.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
TimePickerDialog timePicker = new TimePickerDialog(context, timePickerListener, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), true);
|
||||
timePicker.show();
|
||||
|
||||
txtDate.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (hasFocus) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
DatePickerDialog datePicker = new DatePickerDialog(context, datePickerListener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
|
||||
datePicker.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
txtTime.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (hasFocus) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
TimePickerDialog timePicker = new TimePickerDialog(context, timePickerListener, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), true);
|
||||
timePicker.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!OpenScale.getInstance(this).getScaleDataList().isEmpty())
|
||||
{
|
||||
ScaleData lastScaleData = OpenScale.getInstance(this).getScaleDataList().get(0);
|
||||
|
@@ -211,18 +211,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:ems="10"
|
||||
android:enabled="false"
|
||||
android:inputType="date"
|
||||
android:inputType="none"
|
||||
android:layout_column="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDateSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_set"
|
||||
android:textSize="15sp"
|
||||
android:layout_column="3" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
@@ -252,17 +243,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:ems="10"
|
||||
android:enabled="false"
|
||||
android:inputType="time"
|
||||
android:layout_column="2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTimeSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_set"
|
||||
android:textSize="15sp"
|
||||
android:layout_column="3" />
|
||||
android:layout_column="2"
|
||||
android:inputType="none" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
Reference in New Issue
Block a user