Search in sources :

Example 1 with AboutAdapter

use of io.praveen.typenote.SQLite.AboutAdapter in project Android-NotesApp by HelloPraveen.

the class LicensesActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_licenses);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
    Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
    SpannableStringBuilder SS = new SpannableStringBuilder("Tools & Licenses");
    SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(SS);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    List<String> l = new ArrayList<>();
    l.add("Android Support Libraries");
    l.add("Calligraphy Custom Fonts");
    l.add("Android In-App Billing v3");
    l.add("Material Styled Dialogs");
    final RecyclerView recyclerView = findViewById(R.id.licensesRecyclerView);
    AboutAdapter mAdapter = new AboutAdapter(l);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(mAdapter);
}
Also used : Typeface(android.graphics.Typeface) SpannableStringBuilder(android.text.SpannableStringBuilder) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) AboutAdapter(io.praveen.typenote.SQLite.AboutAdapter) RecyclerView(android.support.v7.widget.RecyclerView) SpannableStringBuilder(android.text.SpannableStringBuilder)

Example 2 with AboutAdapter

use of io.praveen.typenote.SQLite.AboutAdapter in project Android-NotesApp by HelloPraveenIO.

the class AboutActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    bp = new BillingProcessor(this, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApcobfuZFov1KIJgKEKrzp9PP2n1EbBpV/xf9AyhWYN47QY8/rWGPuKht/7b4DmCVnpd6PrnYJqLt/rqR5c+lifLY5XuUH1VGqnkWA33TkPXm4UkGk3q/jvVIbM5xbcdPLqNkLiEoEuBlmAYNxM6K3lf5Kz+ff1HUH1ljYjDE9M38xS0TiLnQIRPm9cfehNxaKWOF81sx5Q9K3vNB1JoNuMyaMfBFQjfMRL6llsMRF42NEf6W/4/2c5Guxvg2qLo14/gGVRLS5H0ZVwqThNZVYTtLRWWNIrgFIwMnCjcbntFkEBK/B987poGN6miDI2r1m6XALRAgLEzM/IUaPnwnWwIDAQAB", this);
    sv = findViewById(R.id.about_scroll);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
    Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
    SpannableStringBuilder SS = new SpannableStringBuilder("About");
    SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(SS);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    List<String> l = new ArrayList<>();
    l.add("Project Contributors");
    l.add("Tools & Licenses Used");
    l.add("Donate and Support");
    l.add("Rate the Application");
    final RecyclerView recyclerView = findViewById(R.id.aboutRecyclerView);
    AboutAdapter mAdapter = new AboutAdapter(l);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(mAdapter);
    recyclerView.addOnItemTouchListener(new RecyclerTouchListener(getApplicationContext(), new ClickListener() {

        @Override
        public void onClick(View view, final int position) {
            if (position == 0) {
                Intent i = new Intent(AboutActivity.this, ContributorsActivity.class);
                startActivity(i);
            } else if (position == 1) {
                Intent i = new Intent(AboutActivity.this, LicensesActivity.class);
                startActivity(i);
            } else if (position == 2) {
                bp.purchase(AboutActivity.this, "typenote_donate");
            } else if (position == 3) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=io.praveen.typenote")));
            }
        }
    }));
}
Also used : RecyclerTouchListener(io.praveen.typenote.SQLite.RecyclerTouchListener) Typeface(android.graphics.Typeface) BillingProcessor(com.anjlab.android.iab.v3.BillingProcessor) SpannableStringBuilder(android.text.SpannableStringBuilder) ArrayList(java.util.ArrayList) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) AboutAdapter(io.praveen.typenote.SQLite.AboutAdapter) RecyclerView(android.support.v7.widget.RecyclerView) SpannableStringBuilder(android.text.SpannableStringBuilder) ClickListener(io.praveen.typenote.SQLite.ClickListener)

Example 3 with AboutAdapter

use of io.praveen.typenote.SQLite.AboutAdapter in project Android-NotesApp by HelloPraveen.

the class AboutActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    bp = new BillingProcessor(this, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApcobfuZFov1KIJgKEKrzp9PP2n1EbBpV/xf9AyhWYN47QY8/rWGPuKht/7b4DmCVnpd6PrnYJqLt/rqR5c+lifLY5XuUH1VGqnkWA33TkPXm4UkGk3q/jvVIbM5xbcdPLqNkLiEoEuBlmAYNxM6K3lf5Kz+ff1HUH1ljYjDE9M38xS0TiLnQIRPm9cfehNxaKWOF81sx5Q9K3vNB1JoNuMyaMfBFQjfMRL6llsMRF42NEf6W/4/2c5Guxvg2qLo14/gGVRLS5H0ZVwqThNZVYTtLRWWNIrgFIwMnCjcbntFkEBK/B987poGN6miDI2r1m6XALRAgLEzM/IUaPnwnWwIDAQAB", this);
    sv = findViewById(R.id.about_scroll);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
    Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
    SpannableStringBuilder SS = new SpannableStringBuilder("About");
    SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(SS);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    List<String> l = new ArrayList<>();
    l.add("Project Contributors");
    l.add("Tools & Licenses Used");
    l.add("Donate and Support");
    l.add("Rate the Application");
    final RecyclerView recyclerView = findViewById(R.id.aboutRecyclerView);
    AboutAdapter mAdapter = new AboutAdapter(l);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(mAdapter);
    recyclerView.addOnItemTouchListener(new RecyclerTouchListener(getApplicationContext(), new ClickListener() {

        @Override
        public void onClick(View view, final int position) {
            if (position == 0) {
                Intent i = new Intent(AboutActivity.this, ContributorsActivity.class);
                startActivity(i);
            } else if (position == 1) {
                Intent i = new Intent(AboutActivity.this, LicensesActivity.class);
                startActivity(i);
            } else if (position == 2) {
                bp.purchase(AboutActivity.this, "typenote_donate");
            } else if (position == 3) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=io.praveen.typenote")));
            }
        }
    }));
}
Also used : RecyclerTouchListener(io.praveen.typenote.SQLite.RecyclerTouchListener) Typeface(android.graphics.Typeface) BillingProcessor(com.anjlab.android.iab.v3.BillingProcessor) SpannableStringBuilder(android.text.SpannableStringBuilder) ArrayList(java.util.ArrayList) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) AboutAdapter(io.praveen.typenote.SQLite.AboutAdapter) RecyclerView(android.support.v7.widget.RecyclerView) SpannableStringBuilder(android.text.SpannableStringBuilder) ClickListener(io.praveen.typenote.SQLite.ClickListener)

Example 4 with AboutAdapter

use of io.praveen.typenote.SQLite.AboutAdapter in project Android-NotesApp by HelloPraveen.

the class ContributorsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_contributors);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
    Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
    SpannableStringBuilder SS = new SpannableStringBuilder("Contributors");
    SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(SS);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    List<String> l = new ArrayList<>();
    l.add("Praveen Thirumurugan");
    l.add("Srikar Nanduri");
    l.add("Bharath Raj Kumar");
    l.add("Keerthana Ravichandran");
    final RecyclerView recyclerView = findViewById(R.id.contributorsRecyclerView);
    AboutAdapter mAdapter = new AboutAdapter(l);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(mAdapter);
}
Also used : Typeface(android.graphics.Typeface) SpannableStringBuilder(android.text.SpannableStringBuilder) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) AboutAdapter(io.praveen.typenote.SQLite.AboutAdapter) RecyclerView(android.support.v7.widget.RecyclerView) SpannableStringBuilder(android.text.SpannableStringBuilder)

Example 5 with AboutAdapter

use of io.praveen.typenote.SQLite.AboutAdapter in project Android-NotesApp by HelloPraveenIO.

the class LicensesActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_licenses);
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
    Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
    SpannableStringBuilder SS = new SpannableStringBuilder("Tools & Licenses");
    SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(SS);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    List<String> l = new ArrayList<>();
    l.add("Android Support Libraries");
    l.add("Calligraphy Custom Fonts");
    l.add("Android In-App Billing v3");
    l.add("Material Styled Dialogs");
    final RecyclerView recyclerView = findViewById(R.id.licensesRecyclerView);
    AboutAdapter mAdapter = new AboutAdapter(l);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(mAdapter);
}
Also used : Typeface(android.graphics.Typeface) SpannableStringBuilder(android.text.SpannableStringBuilder) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) AboutAdapter(io.praveen.typenote.SQLite.AboutAdapter) RecyclerView(android.support.v7.widget.RecyclerView) SpannableStringBuilder(android.text.SpannableStringBuilder)

Aggregations

Typeface (android.graphics.Typeface)6 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)6 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 RecyclerView (android.support.v7.widget.RecyclerView)6 SpannableStringBuilder (android.text.SpannableStringBuilder)6 AboutAdapter (io.praveen.typenote.SQLite.AboutAdapter)6 ArrayList (java.util.ArrayList)6 Intent (android.content.Intent)2 View (android.view.View)2 BillingProcessor (com.anjlab.android.iab.v3.BillingProcessor)2 ClickListener (io.praveen.typenote.SQLite.ClickListener)2 RecyclerTouchListener (io.praveen.typenote.SQLite.RecyclerTouchListener)2