Skip to content

Commit

Permalink
Various Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
blanyal committed Apr 14, 2015
1 parent dda8b0a commit fab3b67
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 15 deletions.
44 changes: 43 additions & 1 deletion app/src/main/java/com/blanyal/remindme/AddReminder.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.getbase.floatingactionbutton.FloatingActionButton;
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog;
import com.wdullaer.materialdatetimepicker.time.RadialPickerLayout;
import com.wdullaer.materialdatetimepicker.time.TimePickerDialog;

import java.util.Calendar;


public class AddReminder extends ActionBarActivity {
public class AddReminder extends ActionBarActivity implements
TimePickerDialog.OnTimeSetListener,
DatePickerDialog.OnDateSetListener{

private Toolbar mToolbar;
private EditText mReminderText;
Expand Down Expand Up @@ -104,9 +110,45 @@ public void afterTextChanged(Editable s) {
mDateText.setText(mDate);
mTimeText.setText(mTime);

}


public void setTime(View v){
Calendar now = Calendar.getInstance();
TimePickerDialog tpd = TimePickerDialog.newInstance(
this,
now.get(Calendar.HOUR_OF_DAY),
now.get(Calendar.MINUTE),
false
);
tpd.setThemeDark(false);
tpd.show(getFragmentManager(), "Timepickerdialog");
}

public void setDate(View v){
Calendar now = Calendar.getInstance();
DatePickerDialog dpd = DatePickerDialog.newInstance(
this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
dpd.show(getFragmentManager(), "Datepickerdialog");
}

@Override
public void onTimeSet(RadialPickerLayout view, int hourOfDay, int minute) {
mTime = hourOfDay + ":" + minute;
mTimeText.setText(mTime);
}

@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
mDate = dayOfMonth + "/" + monthOfYear + "/" + year;
mDateText.setText(mDate);
}



@Override
public void onBackPressed() {
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_add_reminder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
android:textSize="15dp"
android:gravity="center_vertical"
android:layout_marginLeft="72dp"
android:textColor="@color/abc_secondary_text_material_light"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="72dp"/>


Expand Down Expand Up @@ -107,7 +107,7 @@

<TextView
android:id="@+id/date_text"
android:textColor="@color/abc_primary_text_material_light"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
Expand All @@ -117,7 +117,7 @@
android:layout_width="wrap_content"
android:id="@+id/set_date"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_light"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>


Expand Down Expand Up @@ -159,7 +159,7 @@

<TextView
android:id="@+id/time_text"
android:textColor="@color/abc_primary_text_material_light"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
Expand All @@ -169,7 +169,7 @@
android:layout_width="wrap_content"
android:id="@+id/set_time"
android:textSize="15dp"
android:textColor="@color/abc_secondary_text_material_light"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>


Expand Down Expand Up @@ -210,7 +210,7 @@

<TextView
android:id="@+id/repeat_text"
android:textColor="@color/abc_primary_text_material_light"
android:textColor="@color/abc_primary_text_material_dark"
android:layout_width="wrap_content"
android:textSize="15dp"
android:layout_height="wrap_content"
Expand All @@ -221,7 +221,7 @@
android:id="@+id/set_repeat"
android:textSize="15dp"
android:text="@string/repeat_off"
android:textColor="@color/abc_secondary_text_material_light"
android:textColor="@color/abc_secondary_text_material_dark"
android:layout_height="wrap_content"/>


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/primary_dark</item>

<item name="android:actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="android:actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>

<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
<resources>

<color name="toolbar_title">#ffffff</color>
<color name="primary">#f44336</color>
<color name="primary_dark">#d32f2f</color>
<color name="accent">#536dfe</color>
<color name="primary">#009688</color>
<color name="primary_dark">#00796b</color>
<color name="accent">#3f51b5</color>
<color name="control_normal">#888888</color>
<color name="fab_pressed">#3d5afe</color>
<color name="fab_pressed">#3949ab</color>


</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="AppTheme.Base"/>

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme.Base" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>

<item name="actionModeBackground">@color/primary</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>


<item name="android:windowNoTitle">true</item>
Expand Down

0 comments on commit fab3b67

Please sign in to comment.