Skip to content

Instantly share code, notes, and snippets.

View yakivmospan's full-sized avatar

Yakiv Mospan yakivmospan

View GitHub Profile

Android Adapters

@yakivmospan
yakivmospan / 1. Android Custom Actionbar Title.md
Last active August 29, 2015 14:11
Android Custom Actionbar Title

Android Custom Actionbar Title

Important:

  • Use R.layout.ben_toolbar_simple_title if you have menu items in layout, or doesn't have any buttons at all
  • Use R.layout.ben_toolbar_margin_title if you have only one button in left corner (it could be back button for e.g)
/**
* Created by Yakiv M. on 24.07.14.
*/
import android.content.Context;
import android.database.DataSetObservable;
import android.database.DataSetObserver;
import android.os.Build;
import android.util.AttributeSet;
TextView txt = (TextView) findViewById(R.id.custom_fonts);
txt.setTextSize(30);
Typeface font = Typeface.createFromAsset(getAssets(), "Akshar.ttf");
Typeface font2 = Typeface.createFromAsset(getAssets(), "bangla.ttf");
SpannableStringBuilder SS = new SpannableStringBuilder("আমারநல்வரவு");
SS.setSpan (new CustomTypefaceSpan("", font2), 0, 4,Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
SS.setSpan (new CustomTypefaceSpan("", font), 4, 11,Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
txt.setText(SS);
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Android Swipe Refresh