mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 16:53:04 +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.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.DatePicker;
|
import android.widget.DatePicker;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TableRow;
|
import android.widget.TableRow;
|
||||||
@@ -68,8 +67,6 @@ public class NewEntryActivity extends Activity {
|
|||||||
txtDate = (EditText) findViewById(R.id.txtDate);
|
txtDate = (EditText) findViewById(R.id.txtDate);
|
||||||
txtTime = (EditText) findViewById(R.id.txtTime);
|
txtTime = (EditText) findViewById(R.id.txtTime);
|
||||||
txtComment = (EditText) findViewById(R.id.txtComment);
|
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() {
|
findViewById(R.id.btnAdd).setOnClickListener(new View.OnClickListener() {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
@@ -82,23 +79,29 @@ public class NewEntryActivity extends Activity {
|
|||||||
btnOnClickCancel();
|
btnOnClickCancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
btnDateSet.setOnClickListener(new View.OnClickListener() {
|
txtDate.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
public void onClick(View v) {
|
@Override
|
||||||
Calendar cal = Calendar.getInstance();
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
DatePickerDialog datePicker = new DatePickerDialog(context, datePickerListener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
|
if (hasFocus) {
|
||||||
datePicker.show();
|
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();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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())
|
if (!OpenScale.getInstance(this).getScaleDataList().isEmpty())
|
||||||
{
|
{
|
||||||
ScaleData lastScaleData = OpenScale.getInstance(this).getScaleDataList().get(0);
|
ScaleData lastScaleData = OpenScale.getInstance(this).getScaleDataList().get(0);
|
||||||
|
@@ -211,18 +211,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="5"
|
android:layout_weight="5"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:enabled="false"
|
android:inputType="none"
|
||||||
android:inputType="date"
|
|
||||||
android:layout_column="2" />
|
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>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
@@ -252,17 +243,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="5"
|
android:layout_weight="5"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:enabled="false"
|
android:layout_column="2"
|
||||||
android:inputType="time"
|
android:inputType="none" />
|
||||||
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" />
|
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user