Search in sources :

Example 1 with ImageView

use of com.moro.mtweaks.views.recyclerview.ImageView in project MTweaks-KernelAdiutorMOD by morogoku.

the class DonationFragment method addItems.

@Override
protected void addItems(List<RecyclerViewItem> items) {
    TitleView title = new TitleView();
    title.setText(getString(R.string.donation_title));
    items.add(title);
    DescriptionView desc = new DescriptionView();
    desc.setDrawable(getResources().getDrawable(R.drawable.logo));
    desc.setSummary(getString(R.string.donation_summary));
    desc.setOnItemClickListener(new RecyclerViewItem.OnItemClickListener() {

        @Override
        public void onClick(RecyclerViewItem item) {
            Utils.launchUrl("https://www.paypal.me/morogoku", getActivity());
        }
    });
    items.add(desc);
    String leng = Locale.getDefault().getLanguage();
    ImageView img = new ImageView();
    if (leng.contains("es")) {
        img.setDrawable(getResources().getDrawable(R.drawable.ic_donar_paypal));
    } else {
        img.setDrawable(getResources().getDrawable(R.drawable.ic_donate_paypal));
    }
    img.setOnItemClickListener(new RecyclerViewItem.OnItemClickListener() {

        @Override
        public void onClick(RecyclerViewItem item) {
            Utils.launchUrl("https://www.paypal.me/morogoku", getActivity());
        }
    });
    items.add(img);
}
Also used : DescriptionView(com.moro.mtweaks.views.recyclerview.DescriptionView) TitleView(com.moro.mtweaks.views.recyclerview.TitleView) ImageView(com.moro.mtweaks.views.recyclerview.ImageView) RecyclerViewItem(com.moro.mtweaks.views.recyclerview.RecyclerViewItem)

Aggregations

DescriptionView (com.moro.mtweaks.views.recyclerview.DescriptionView)1 ImageView (com.moro.mtweaks.views.recyclerview.ImageView)1 RecyclerViewItem (com.moro.mtweaks.views.recyclerview.RecyclerViewItem)1 TitleView (com.moro.mtweaks.views.recyclerview.TitleView)1