use of android.widget.ImageView in project making-apps-beautiful by ankurkotwal.
the class ArticleDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_article_detail, container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
((TextView) rootView.findViewById(R.id.article_title)).setText(mItem.title);
((TextView) rootView.findViewById(R.id.article_byline)).setText(Html.fromHtml(mItem.time + " by " + mItem.author));
// ((TextView) rootView.findViewById(R.id.article_date))
// .setText(mItem.time);
((TextView) rootView.findViewById(R.id.article_body)).setText(Html.fromHtml(mItem.content));
((ImageView) rootView.findViewById(R.id.photo)).setImageDrawable(getResources().getDrawable(mItem.photoResId));
}
return rootView;
}
use of android.widget.ImageView in project making-apps-beautiful by ankurkotwal.
the class ArticleDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_article_detail, container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
((TextView) rootView.findViewById(R.id.article_title)).setText(mItem.title);
((TextView) rootView.findViewById(R.id.article_byline)).setText(Html.fromHtml(mItem.time.toUpperCase(Locale.getDefault()) + " BY <font color='" + getResources().getString(R.string.author_font_color) + "'>" + mItem.author.toUpperCase(Locale.getDefault()) + "</a>"));
// ((TextView) rootView.findViewById(R.id.article_date))
// .setText(mItem.time);
((TextView) rootView.findViewById(R.id.article_body)).setText(Html.fromHtml(mItem.content));
((TextView) rootView.findViewById(R.id.article_body)).setTypeface(Typeface.createFromAsset(getResources().getAssets(), "Rosario-Regular.ttf"));
((ImageView) rootView.findViewById(R.id.photo)).setImageDrawable(getResources().getDrawable(mItem.photoResId));
}
return rootView;
}
use of android.widget.ImageView in project making-apps-beautiful by ankurkotwal.
the class ArticleDetailFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_article_detail, container, false);
// Show the dummy content as text in a TextView.
if (mItem != null) {
((TextView) rootView.findViewById(R.id.article_title)).setText(mItem.title);
((TextView) rootView.findViewById(R.id.article_byline)).setText(Html.fromHtml(mItem.time.toUpperCase(Locale.getDefault()) + " BY <font color='" + getResources().getString(R.string.author_font_color) + "'>" + mItem.author.toUpperCase(Locale.getDefault()) + "</a>"));
// ((TextView) rootView.findViewById(R.id.article_date))
// .setText(mItem.time);
((TextView) rootView.findViewById(R.id.article_body)).setText(Html.fromHtml(mItem.content));
((TextView) rootView.findViewById(R.id.article_body)).setTypeface(Typeface.createFromAsset(getResources().getAssets(), "Rosario-Regular.ttf"));
((ImageView) rootView.findViewById(R.id.photo)).setImageDrawable(getResources().getDrawable(mItem.photoResId));
}
return rootView;
}
use of android.widget.ImageView in project plaid by nickbutcher.
the class DesignerNewsLogin method showLoggedInUser.
private void showLoggedInUser() {
final Call<User> authedUser = designerNewsPrefs.getApi().getAuthedUser();
authedUser.enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
final User user = response.body();
designerNewsPrefs.setLoggedInUser(user);
final Toast confirmLogin = new Toast(getApplicationContext());
final View v = LayoutInflater.from(DesignerNewsLogin.this).inflate(R.layout.toast_logged_in_confirmation, null, false);
((TextView) v.findViewById(R.id.name)).setText(user.display_name.toLowerCase());
// need to use app context here as the activity will be destroyed shortly
Glide.with(getApplicationContext()).load(user.portrait_url).placeholder(R.drawable.avatar_placeholder).transform(new CircleTransform(getApplicationContext())).into((ImageView) v.findViewById(R.id.avatar));
v.findViewById(R.id.scrim).setBackground(ScrimUtil.makeCubicGradientScrimDrawable(ContextCompat.getColor(DesignerNewsLogin.this, R.color.scrim), 5, Gravity.BOTTOM));
confirmLogin.setView(v);
confirmLogin.setGravity(Gravity.BOTTOM | Gravity.FILL_HORIZONTAL, 0, 0);
confirmLogin.setDuration(Toast.LENGTH_LONG);
confirmLogin.show();
}
@Override
public void onFailure(Call<User> call, Throwable t) {
Log.e(getClass().getCanonicalName(), t.getMessage(), t);
}
});
}
use of android.widget.ImageView in project plaid by nickbutcher.
the class DribbbleLogin method showLoggedInUser.
void showLoggedInUser() {
final Call<User> authenticatedUser = dribbblePrefs.getApi().getAuthenticatedUser();
authenticatedUser.enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
final User user = response.body();
dribbblePrefs.setLoggedInUser(user);
final Toast confirmLogin = new Toast(getApplicationContext());
final View v = LayoutInflater.from(DribbbleLogin.this).inflate(R.layout.toast_logged_in_confirmation, null, false);
((TextView) v.findViewById(R.id.name)).setText(user.name.toLowerCase());
// need to use app context here as the activity will be destroyed shortly
Glide.with(getApplicationContext()).load(user.avatar_url).placeholder(R.drawable.ic_player).transform(new CircleTransform(getApplicationContext())).into((ImageView) v.findViewById(R.id.avatar));
v.findViewById(R.id.scrim).setBackground(ScrimUtil.makeCubicGradientScrimDrawable(ContextCompat.getColor(DribbbleLogin.this, R.color.scrim), 5, Gravity.BOTTOM));
confirmLogin.setView(v);
confirmLogin.setGravity(Gravity.BOTTOM | Gravity.FILL_HORIZONTAL, 0, 0);
confirmLogin.setDuration(Toast.LENGTH_LONG);
confirmLogin.show();
}
@Override
public void onFailure(Call<User> call, Throwable t) {
}
});
}
Aggregations