예제 #1
0
 public cardbox(View v, String tag) {
   _title = (TextView) v.findViewById(R.id.title);
   content = (TextView) v.findViewById(R.id.context_conten);
   _title.setText(tag);
   holder = v;
   this.tag = tag;
 }
예제 #2
0
 public void setDesc(final String desc) {
   content.setText(desc);
 }
예제 #3
0
 public void setTitle(final String title) {
   _title.setText(title);
 }
예제 #4
0
  private static void showRateDialog(
      final Activity mActivity,
      String message,
      String rateBtn,
      String dismissBtn,
      String laterBtn,
      final SharedPreferences.Editor editor) {

    final AlertDialog.Builder dialog = new AlertDialog.Builder(mActivity);

    // Inflate layout
    LayoutInflater inflater = mActivity.getLayoutInflater();
    View v = inflater.inflate(R.layout.rate_app_dialog_layout, null);
    dialog.setView(v);

    // Instantiate and populate views
    TextView messageTextView = (TextView) v.findViewById(R.id.rate_message);
    messageTextView.setText(message);
    final CheckBox dismissCheckbox = (CheckBox) v.findViewById(R.id.rate_checkbox);
    dismissCheckbox.setText(dismissBtn);

    dialog
        //			.setTitle(APP_TITLE)
        //			.setMessage(message)
        .setPositiveButton(
            rateBtn,
            new DialogInterface.OnClickListener() {
              @Override
              public void onClick(DialogInterface dialog, int which) {
                mActivity.startActivity(
                    new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));
                editor.putBoolean(Constants.PREF_RATE_DISMISSED, true).commit();
                dialog.dismiss();
              }
            })
        .setNeutralButton(
            laterBtn,
            new DialogInterface.OnClickListener() {

              @Override
              public void onClick(DialogInterface dialog, int which) {
                if (dismissCheckbox.isChecked()) {
                  editor.putBoolean(Constants.PREF_RATE_DISMISSED, true).commit();
                } else {
                  editor.putLong(Constants.PREF_FIRST_LAUNCH, System.currentTimeMillis()).commit();
                }
                dialog.dismiss();
              }
            });
    //			.setNegativeButton(dismissBtn, new DialogInterface.OnClickListener() {
    //
    //				@Override
    //				public void onClick(DialogInterface dialog, int which) {
    //					if (editor != null) {
    //						editor.putBoolean(Constants.PREF_RATE_DISMISSED, true).commit();
    //					}
    //					dialog.dismiss();
    //				}
    //			});

    dialog.show();
  }