use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class HelpActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
((WordPress) getApplication()).component().inject(this);
initHelpshiftLayout();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setHomeAsUpIndicator(R.drawable.ic_cross_white_24dp);
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
//remove shadow
actionBar.setElevation(0);
}
// Init common elements
WPTextView version = (WPTextView) findViewById(R.id.nux_help_version);
version.setText(getString(R.string.version) + " " + WordPress.versionName);
WPTextView applogButton = (WPTextView) findViewById(R.id.applog_button);
applogButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(v.getContext(), AppLogViewerActivity.class));
}
});
}
use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class SignInDialogFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
getDialog().getWindow().setBackgroundDrawable(getResources().getDrawable(R.color.nux_alert_bg));
View v = inflater.inflate(R.layout.signin_dialog_fragment, container, false);
mImageView = (ImageView) v.findViewById(R.id.nux_dialog_image);
mTitleTextView = (WPTextView) v.findViewById(R.id.nux_dialog_title);
mDescriptionTextView = (WPTextView) v.findViewById(R.id.nux_dialog_description);
mFooterBottomButton = (WPTextView) v.findViewById(R.id.nux_dialog_first_button);
mFooterTopButton = (WPTextView) v.findViewById(R.id.nux_dialog_third_button);
mFooterCenterButton = (WPTextView) v.findViewById(R.id.nux_dialog_second_button);
final Bundle arguments = getArguments();
mTitleTextView.setText(arguments.getString(ARG_TITLE));
mDescriptionTextView.setText(arguments.getString(ARG_DESCRIPTION));
mImageView.setImageResource(arguments.getInt(ARG_IMAGE));
View.OnClickListener clickListenerDismiss = new View.OnClickListener() {
@Override
public void onClick(View v) {
dismissAllowingStateLoss();
}
};
View.OnClickListener clickListenerSecondButton = new View.OnClickListener() {
@Override
public void onClick(View v) {
onClickAction(v, arguments.getInt(ARG_SECOND_BUTTON_ACTION, 0), arguments);
}
};
View.OnClickListener clickListenerThirdButton = new View.OnClickListener() {
@Override
public void onClick(View v) {
onClickAction(v, arguments.getInt(ARG_THIRD_BUTTON_ACTION, 0), arguments);
}
};
switch(arguments.getInt(ARG_NUMBER_OF_BUTTONS, 1)) {
case 1:
// One button: we keep only the centered button
mFooterCenterButton.setText(arguments.getString(ARG_FIRST_BUTTON_LABEL));
mFooterCenterButton.setOnClickListener(clickListenerDismiss);
mFooterBottomButton.setVisibility(View.GONE);
mFooterTopButton.setVisibility(View.GONE);
break;
case 2:
// Two buttons: we keep only the left and right buttons
mFooterBottomButton.setText(arguments.getString(ARG_FIRST_BUTTON_LABEL));
mFooterTopButton.setText(arguments.getString(ARG_SECOND_BUTTON_LABEL));
mFooterCenterButton.setVisibility(View.GONE);
mFooterTopButton.setOnClickListener(clickListenerSecondButton);
break;
case 3:
mFooterBottomButton.setText(arguments.getString(ARG_FIRST_BUTTON_LABEL));
mFooterCenterButton.setText(arguments.getString(ARG_SECOND_BUTTON_LABEL));
mFooterCenterButton.setOnClickListener(clickListenerSecondButton);
mFooterTopButton.setText(arguments.getString(ARG_THIRD_BUTTON_LABEL));
mFooterTopButton.setOnClickListener(clickListenerThirdButton);
break;
}
v.setClickable(true);
v.setOnClickListener(clickListenerDismiss);
mFooterBottomButton.setOnClickListener(clickListenerDismiss);
return v;
}
use of org.wordpress.android.widgets.WPTextView in project WordPress-Android by wordpress-mobile.
the class PromoDialog method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Button btn = (Button) view.findViewById(R.id.promo_dialog_cancel_button);
btn.setText(mButtonLabelId);
ImageView image = (ImageView) view.findViewById(R.id.promo_dialog_image);
Drawable drawable = VectorDrawableCompat.create(getResources(), mDrawableId, null);
image.setImageDrawable(drawable);
WPTextView title = (WPTextView) view.findViewById(R.id.promo_dialog_title);
title.setText(mTitleId);
WPTextView desc = (WPTextView) view.findViewById(R.id.promo_dialog_description);
desc.setText(mDescriptionId);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getDialog().cancel();
}
});
}
Aggregations