Android Open Source - FontPagerTitleStrip Main Activity






From Project

Back to project page FontPagerTitleStrip.

License

The source code is released under:

GNU General Public License

If you think the Android project FontPagerTitleStrip 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 me.alexrs.fontpagertitlestrip;
/*  w  w w. j  av a  2 s.c  o  m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;


public class MainActivity extends Activity implements AdapterView.OnItemClickListener {


    private String[] items = new String[]{
            "Default",
            "By family name",
            "From assets",
            "By typeface"
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ListView listView = (ListView) findViewById(R.id.listView);
        listView.setOnItemClickListener(this);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);
        listView.setAdapter(adapter);


    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

        Intent intent = new Intent(this, ViewPagerActivity.class);
        intent.putExtra("POS", position);
        startActivity(intent);
    }
}




Java Source Code List

me.alexrs.fontpagertitlestrip.MainActivity.java
me.alexrs.fontpagertitlestrip.ViewPagerActivity.java
me.alexrs.fontpagertitlestrip.lib.FontPagerTitleStrip.java
me.alexrs.fontpagertitlestrip.lib.Typefaces.java