use of com.waz.zclient.ui.views.ZetaButton in project wire-android by wireapp.
the class FirstTimeAssignUsernameFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_username_first_launch, container, false);
nameTextView = ViewUtils.getView(view, R.id.ttv__name);
usernameTextView = ViewUtils.getView(view, R.id.ttv__username);
backgroundImageView = ViewUtils.getView(view, R.id.iaiv__user_photo);
final ImageView vignetteOverlay = ViewUtils.getView(view, R.id.iv_background_vignette_overlay);
ZetaButton chooseYourOwnButton = ViewUtils.getView(view, R.id.zb__username_first_assign__choose);
ZetaButton keepButton = ViewUtils.getView(view, R.id.zb__username_first_assign__keep);
TypefaceTextView summaryTextView = ViewUtils.getView(view, R.id.ttv__username_first_assign__summary);
AccentColor accentColor = getControllerFactory().getAccentColorController().getAccentColor();
final int color = accentColor != null ? accentColor.getColor() : Color.TRANSPARENT;
final int darkenColor = ColorUtils.injectAlpha(ResourceUtils.getResourceFloat(getResources(), R.dimen.background_solid_black_overlay_opacity), Color.BLACK);
backgroundImageView.setDisplayType(ImageAssetImageView.DisplayType.REGULAR);
vignetteOverlay.setImageBitmap(BitmapUtils.getVignetteBitmap(getResources()));
vignetteOverlay.setColorFilter(darkenColor, PorterDuff.Mode.DARKEN);
selfModelObserver.setAndUpdate(getStoreFactory().getZMessagingApiStore().getApi().getSelf());
chooseYourOwnButton.setIsFilled(true);
chooseYourOwnButton.setAccentColor(color);
chooseYourOwnButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getContainer().onChooseUsernameChosen();
}
});
suggestedUsername = getArguments().getString(ARG_SUGGESTED_USERNAME, "");
keepButton.setIsFilled(false);
keepButton.setAccentColor(color);
keepButton.setTextColor(getResources().getColor(R.color.white));
keepButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getContainer().onKeepUsernameChosen(suggestedUsername);
}
});
nameTextView.setText(getArguments().getString(ARG_NAME, ""));
usernameTextView.setText(StringUtils.formatHandle(suggestedUsername));
if (TextUtils.isEmpty(suggestedUsername)) {
usernameTextView.setVisibility(View.INVISIBLE);
keepButton.setVisibility(View.GONE);
}
TextViewUtils.linkifyText(summaryTextView, Color.WHITE, com.waz.zclient.ui.R.string.wire__typeface__light, false, new Runnable() {
@Override
public void run() {
((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new OpenedUsernameFAQEvent());
getContainer().onOpenUrl(getString(R.string.usernames__learn_more__link));
}
});
return view;
}
use of com.waz.zclient.ui.views.ZetaButton in project wire-android by wireapp.
the class UpdateFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_update, container, false);
ZetaButton zetaButton = ViewUtils.getView(view, R.id.zb__update__download);
zetaButton.setAccentColor(getResources().getColor(R.color.forced_update__button__background_color));
zetaButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
launchDownloadLink();
}
});
return view;
}
Aggregations