Skip to content

Commit

Permalink
Added dialog to sample
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyab committed May 30, 2014
1 parent c70cb44 commit a36d0cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package uk.co.chrisjenx.calligraphy.sample;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
Expand Down Expand Up @@ -54,9 +56,23 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
ButterKnife.inject(this, view);
}

@OnClick({R.id.button_default, R.id.button_bold})
public void onClickButton() {
@OnClick({R.id.button_bold})
public void onClickBoldButton() {
Toast.makeText(getActivity(), "Custom Typeface toast text", Toast.LENGTH_SHORT).show();
}

@OnClick({R.id.button_default})
public void onClickDefaultButton() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage("Custom Typeface Dialog");
builder.setTitle("Sample Dialog");
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
}
}
}
4 changes: 2 additions & 2 deletions CalligraphySample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string name="defined_in_style">\nThis has the font family defined in the style as Roboto Condensed.\n</string>
<string name="defined_custom_view">This is a custom TextView with custom font.\n</string>

<string name="button_default">Default Font</string>
<string name="button_defined">Bold Button</string>
<string name="button_default">Default Font (show dialog)</string>
<string name="button_defined">Bold Button (show toast)</string>

</resources>

0 comments on commit a36d0cc

Please sign in to comment.