Search in sources :

Example 81 with ImageView

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;
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 82 with ImageView

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;
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 83 with ImageView

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;
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 84 with ImageView

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);
        }
    });
}
Also used : User(io.plaidapp.data.api.designernews.model.User) Toast(android.widget.Toast) CircleTransform(io.plaidapp.util.glide.CircleTransform) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) AutoCompleteTextView(android.widget.AutoCompleteTextView)

Example 85 with ImageView

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) {
        }
    });
}
Also used : User(io.plaidapp.data.api.dribbble.model.User) Toast(android.widget.Toast) CircleTransform(io.plaidapp.util.glide.CircleTransform) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

ImageView (android.widget.ImageView)2257 View (android.view.View)1144 TextView (android.widget.TextView)1005 Intent (android.content.Intent)200 Drawable (android.graphics.drawable.Drawable)197 LinearLayout (android.widget.LinearLayout)192 Bitmap (android.graphics.Bitmap)178 ViewGroup (android.view.ViewGroup)163 LayoutInflater (android.view.LayoutInflater)159 OnClickListener (android.view.View.OnClickListener)145 AdapterView (android.widget.AdapterView)111 ListView (android.widget.ListView)103 RecyclerView (android.support.v7.widget.RecyclerView)102 FrameLayout (android.widget.FrameLayout)97 Button (android.widget.Button)83 Bundle (android.os.Bundle)81 BitmapDrawable (android.graphics.drawable.BitmapDrawable)80 RelativeLayout (android.widget.RelativeLayout)72 Test (org.junit.Test)70 Context (android.content.Context)69