|
4 | 4 | import android.app.DatePickerDialog; |
5 | 5 | import android.app.DialogFragment; |
6 | 6 | import android.app.TimePickerDialog; |
| 7 | +import android.content.Context; |
7 | 8 | import android.content.Intent; |
8 | 9 | import android.os.Bundle; |
9 | 10 | import android.support.design.widget.TextInputLayout; |
10 | 11 | import android.support.v7.app.AppCompatActivity; |
11 | 12 | import android.support.v7.widget.SwitchCompat; |
12 | 13 | import android.support.v7.widget.Toolbar; |
| 14 | +import android.util.Log; |
| 15 | +import android.view.Display; |
13 | 16 | import android.view.MenuItem; |
14 | 17 | import android.view.View; |
| 18 | +import android.view.WindowManager; |
15 | 19 | import android.view.inputmethod.InputMethodManager; |
16 | 20 | import android.widget.Button; |
17 | 21 | import android.widget.DatePicker; |
18 | 22 | import android.widget.EditText; |
19 | 23 | import android.widget.RelativeLayout; |
| 24 | +import android.widget.TextView; |
20 | 25 | import android.widget.TimePicker; |
21 | 26 |
|
22 | 27 | import java.util.Calendar; |
|
26 | 31 | import apps.jizzu.simpletodo.fragment.TimePickerFragment; |
27 | 32 | import apps.jizzu.simpletodo.utils.Utils; |
28 | 33 |
|
| 34 | +import static android.content.ContentValues.TAG; |
| 35 | + |
29 | 36 | /** |
30 | 37 | * Activity for adding a new task to RecyclerView. |
31 | 38 | */ |
@@ -62,6 +69,17 @@ protected void onCreate(Bundle savedInstanceState) { |
62 | 69 | mTime = findViewById(R.id.taskTime); |
63 | 70 | Button addTaskButton = findViewById(R.id.addTaskButton); |
64 | 71 | mReminderSwitch = findViewById(R.id.reminderSwitch); |
| 72 | + TextView reminderText = findViewById(R.id.tvSetReminder); |
| 73 | + |
| 74 | + // Get the resolution of the user's screen |
| 75 | + Display d = ((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); |
| 76 | + int width = d.getWidth(); |
| 77 | + int height = d.getHeight(); |
| 78 | + Log.d(TAG, "width = " + width + ", height = " + height); |
| 79 | + |
| 80 | + if (width >= 480 || height >= 800) { |
| 81 | + reminderText.setText(R.string.set_reminder_short); |
| 82 | + } |
65 | 83 |
|
66 | 84 | mReminderLayout.setVisibility(View.INVISIBLE); |
67 | 85 |
|
|
0 commit comments