Created
August 27, 2015 14:25
-
-
Save ppamorim/c3c1248eaefeb843949e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.camerite.ui.dialog; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.DialogInterface; | |
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.widget.TextView; | |
import com.camerite.R; | |
public class HappyDialog extends DialogFragment { | |
private TextView someText; | |
@Override public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setStyle(STYLE_NO_FRAME, android.R.style.Theme_Translucent); | |
} | |
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { | |
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); | |
LayoutInflater inflater = getActivity().getLayoutInflater(); | |
View view = inflater.inflate(R.layout.dialog_happy, null); | |
if(view != null) { | |
someText = (TextView) view.findViewById(R.id.ok_button); | |
someText.setOnClickListener(new View.OnClickListener() { | |
@Override public void onClick(View view) { | |
//do something | |
} | |
}); | |
} | |
builder.setView(view); | |
return builder.create(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment