Android Open Source - Yeah-MaterialLove About Adapter






From Project

Back to project page Yeah-MaterialLove.

License

The source code is released under:

Apache License

If you think the Android project Yeah-MaterialLove listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.yeahdev.materiallovetesting.adapter;
// ww  w .  j a  va2  s.  c  om

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.devspark.robototextview.widget.RobotoTextView;
import com.yeahdev.materiallovetesting.R;

public class AboutAdapter extends ArrayAdapter<String> {
    /**
     * Tutorial:
     * http://www.androidhive.info/2014/02/android-login-with-google-plus-account-1/
     */
    private Context mContext;

    private final static String[] ABOUTTITLE = {
            "Android-RobotoTextView by johnkil",
            "CircleImageView by hdodenhof",
            "Easy Adapter by ribot",
            "FloatingActionButton by makovkastar",
            "Material Dialogs by afollestad",
            "ShowcaseView by amlcurran",
            "Snackbar by wmora",
            "SystemBarTint by jgilfelt"
    };

    private final static String[] ABOUTLINKS = {
            "https://github.com/johnkil/Android-RobotoTextView",
            "https://github.com/hdodenhof/CircleImageView",
            "https://github.com/ribot/easy-adapter",
            "https://github.com/makovkastar/FloatingActionButton",
            "https://github.com/afollestad/material-dialogs",
            "https://github.com/amlcurran/ShowcaseView",
            "https://github.com/wmora/snackbar",
            "https://github.com/jgilfelt/SystemBarTint"
    };

    public AboutAdapter(Context context) {
        super(context, R.layout.listview_item_about);
        this.mContext = context;
    }

    @Override
    public int getCount() {
        return ABOUTTITLE.length;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.listview_item_about, parent, false);
        }

        RobotoTextView tvTitle = (RobotoTextView) convertView.findViewById(R.id.tvAboutTitle);
        tvTitle.setText(ABOUTTITLE[position]);

        RobotoTextView tvLink = (RobotoTextView) convertView.findViewById(R.id.tvAboutLink);
        tvLink.setText(ABOUTLINKS[position]);
        tvLink.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(ABOUTLINKS[position])));
            }
        });

        return convertView;
    }
}




Java Source Code List

com.yeahdev.materiallovetesting.ApplicationTest.java
com.yeahdev.materiallovetesting.activities.GPlusLoginActivity.java
com.yeahdev.materiallovetesting.activities.MainActivity.java
com.yeahdev.materiallovetesting.adapter.AboutAdapter.java
com.yeahdev.materiallovetesting.adapter.CoveredTechnicAdapter.java
com.yeahdev.materiallovetesting.adapter.DrawerListAdapter.java
com.yeahdev.materiallovetesting.easyadapterexample.BlindtextViewHolder.java
com.yeahdev.materiallovetesting.easyadapterexample.Blindtext.java
com.yeahdev.materiallovetesting.easyadapterexample.DataProvider.java
com.yeahdev.materiallovetesting.fragments.AboutFragment.java
com.yeahdev.materiallovetesting.fragments.BugreportFragment.java
com.yeahdev.materiallovetesting.fragments.FeedbackFragment.java
com.yeahdev.materiallovetesting.fragments.GithubIssusFragment.java
com.yeahdev.materiallovetesting.fragments.RecyclerViewFragment.java
com.yeahdev.materiallovetesting.fragments.WelcomeFragment.java
com.yeahdev.materiallovetesting.interfaces.IPassSelectedFragmentFromFAB.java