Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from rey5137/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rey5137 committed Apr 2, 2015
2 parents 8509171 + 8b1f673 commit 1d3c3c7
Show file tree
Hide file tree
Showing 30 changed files with 677 additions and 381 deletions.
2 changes: 1 addition & 1 deletion Material.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="com.github.rey5137" external.system.module.version="1.0.0" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="com.github.rey5137" external.system.module.version="1.0.1" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
Expand Down
2 changes: 1 addition & 1 deletion app/app.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.github.rey5137" external.system.module.version="1.0.0" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.github.rey5137" external.system.module.version="1.0.1" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand Down
54 changes: 27 additions & 27 deletions app/src/main/java/com/rey/material/demo/DialogsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ public void onClick(View v) {

switch (v.getId()){
case R.id.dialog_bt_title_only:
builder = new SimpleDialog.Builder(R.style.Material_App_Dialog_Simple_Light){
builder = new SimpleDialog.Builder(R.style.SimpleDialogLight){
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Discarded", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Discarded", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Canceled", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Canceled", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -92,16 +92,16 @@ public void onNegativeActionClicked(DialogFragment fragment) {
.negativeAction("CANCEL");
break;
case R.id.dialog_bt_msg_only:
builder = new SimpleDialog.Builder(R.style.Material_App_Dialog_Simple){
builder = new SimpleDialog.Builder(R.style.SimpleDialog){
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Deleted", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Deleted", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -111,16 +111,16 @@ public void onNegativeActionClicked(DialogFragment fragment) {
.negativeAction("CANCEL");
break;
case R.id.dialog_bt_title_msg:
builder = new SimpleDialog.Builder(R.style.Material_App_Dialog_Simple_Light){
builder = new SimpleDialog.Builder(R.style.SimpleDialogLight){
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Agreed", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Agreed", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Disagreed", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Disagreed", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -131,7 +131,7 @@ public void onNegativeActionClicked(DialogFragment fragment) {
.negativeAction("DISAGREE");
break;
case R.id.dialog_bt_custom:
builder = new SimpleDialog.Builder(R.style.Material_App_Dialog){
builder = new SimpleDialog.Builder(R.style.SimpleDialog){

@Override
protected Dialog onBuild(Context context, int styleId) {
Expand All @@ -142,13 +142,13 @@ protected Dialog onBuild(Context context, int styleId) {

@Override
public void onPositiveActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Connected", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Connected", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -159,17 +159,17 @@ public void onNegativeActionClicked(DialogFragment fragment) {
.contentView(R.layout.layout_dialog_custom);
break;
case R.id.dialog_bt_choice:
builder = new SimpleDialog.Builder(R.style.Material_App_Dialog_Simple_Light){
builder = new SimpleDialog.Builder(R.style.SimpleDialogLight){
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
SimpleDialog dialog = (SimpleDialog)fragment.getDialog();
Toast.makeText(fragment.getActivity(), "You have selected " + dialog.getSelectedValue() + " as phone ringtone.", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "You have selected " + dialog.getSelectedValue() + " as phone ringtone.", Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled" , Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled" , Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -180,26 +180,26 @@ public void onNegativeActionClicked(DialogFragment fragment) {
.negativeAction("CANCEL");
break;
case R.id.dialog_bt_multi_choice:
builder = new SimpleDialog.Builder(R.style.Material_App_Dialog_Simple){
builder = new SimpleDialog.Builder(R.style.SimpleDialog){
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
SimpleDialog dialog = (SimpleDialog)fragment.getDialog();
CharSequence[] values = dialog.getSelectedValues();
if(values == null)
Toast.makeText(fragment.getActivity(), "You have selected nothing.", Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "You have selected nothing.", Toast.LENGTH_SHORT).show();
else{
StringBuffer sb = new StringBuffer();
sb.append("You have selected ");
for(int i = 0; i < values.length; i++)
sb.append(values[i]).append(i == values.length - 1? "." : ", ");
Toast.makeText(fragment.getActivity(), sb.toString(), Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), sb.toString(), Toast.LENGTH_SHORT).show();
}
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled" , Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled" , Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -214,13 +214,13 @@ public void onNegativeActionClicked(DialogFragment fragment) {
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
TimePickerDialog dialog = (TimePickerDialog)fragment.getDialog();
Toast.makeText(fragment.getActivity(), "Time is " + dialog.getFormattedTime(SimpleDateFormat.getTimeInstance()), Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Time is " + dialog.getFormattedTime(SimpleDateFormat.getTimeInstance()), Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled" , Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled" , Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -234,13 +234,13 @@ public void onNegativeActionClicked(DialogFragment fragment) {
public void onPositiveActionClicked(DialogFragment fragment) {
DatePickerDialog dialog = (DatePickerDialog)fragment.getDialog();
String date = dialog.getFormattedDate(SimpleDateFormat.getDateInstance());
Toast.makeText(fragment.getActivity(), "Date is " + date, Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Date is " + date, Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled" , Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled" , Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -253,13 +253,13 @@ public void onNegativeActionClicked(DialogFragment fragment) {
@Override
public void onPositiveActionClicked(DialogFragment fragment) {
TimePickerDialog dialog = (TimePickerDialog)fragment.getDialog();
Toast.makeText(fragment.getActivity(), "Time is " + dialog.getFormattedTime(SimpleDateFormat.getTimeInstance()), Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Time is " + dialog.getFormattedTime(SimpleDateFormat.getTimeInstance()), Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled" , Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled" , Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand All @@ -273,13 +273,13 @@ public void onNegativeActionClicked(DialogFragment fragment) {
public void onPositiveActionClicked(DialogFragment fragment) {
DatePickerDialog dialog = (DatePickerDialog)fragment.getDialog();
String date = dialog.getFormattedDate(SimpleDateFormat.getDateInstance());
Toast.makeText(fragment.getActivity(), "Date is " + date, Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Date is " + date, Toast.LENGTH_SHORT).show();
fragment.dismiss();
}

@Override
public void onNegativeActionClicked(DialogFragment fragment) {
Toast.makeText(fragment.getActivity(), "Cancelled" , Toast.LENGTH_SHORT).show();
Toast.makeText(fragment.getDialog().getContext(), "Cancelled" , Toast.LENGTH_SHORT).show();
fragment.dismiss();
}
};
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/anim/anim_scale_in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="@android:integer/config_mediumAnimTime"
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale="0.9"
android:toXScale="1.0"
android:fromYScale="0.9"
android:toYScale="1.0"/>

<alpha
android:duration="@android:integer/config_mediumAnimTime"
android:fromAlpha="0"
android:toAlpha="1.0"/>

</set>
17 changes: 17 additions & 0 deletions app/src/main/res/anim/anim_scale_out.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="@android:integer/config_mediumAnimTime"
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale="1.0"
android:toXScale="0.9"
android:fromYScale="1.0"
android:toYScale="0.9"/>

<alpha
android:duration="@android:integer/config_mediumAnimTime"
android:fromAlpha="1.0"
android:toAlpha="0.0"/>

</set>
10 changes: 10 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@
<item name="lmd_strokeColor">#FF000000</item>
</style>

<style name="SimpleDialog" parent="Material.App.Dialog.Simple">
<item name="di_inAnimation">@anim/anim_scale_in</item>
<item name="di_outAnimation">@anim/anim_scale_out</item>
</style>

<style name="SimpleDialogLight" parent="Material.App.Dialog.Simple.Light">
<item name="di_inAnimation">@anim/anim_scale_in</item>
<item name="di_outAnimation">@anim/anim_scale_out</item>
</style>

<!-- ContactView -->
<style name="ContactView">
<item name="android:minHeight">56dp</item>
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=1.0.0
VERSION_CODE=2
VERSION_NAME=1.0.1
VERSION_CODE=3
GROUP=com.github.rey5137

POM_DESCRIPTION= An Android library to bring Material Design UI to pre-Lolipop Android.
Expand Down
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
versionCode 3
versionName "1.0.1"
}
buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.github.rey5137" external.system.module.version="1.0.0" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.github.rey5137" external.system.module.version="1.0.1" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand Down
Loading

0 comments on commit 1d3c3c7

Please sign in to comment.