Search in sources :

Example 1 with TypefaceSpan

use of com.jams.music.player.Utils.TypefaceSpan in project JamsMusicPlayer by psaravan.

the class NowPlayingQueueActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    mContext = this;
    sharedPreferences = getSharedPreferences("com.jams.music.player", Context.MODE_PRIVATE);
    //Get the screen's parameters.
    DisplayMetrics displayMetrics = new DisplayMetrics();
    this.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    int screenWidth = displayMetrics.widthPixels;
    //Set the UI theme.
    if (sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME").equals("DARK_THEME") || sharedPreferences.getString(Common.CURRENT_THEME, "LIGHT_CARDS_THEME").equals("DARK_CARDS_THEME")) {
        setTheme(R.style.AppTheme);
    } else {
        setTheme(R.style.AppThemeLight);
    }
    super.onCreate(savedInstanceState);
    if (getOrientation().equals("PORTRAIT")) {
        //Finish this activity and relaunch the activity that called this one.
        Intent intent = new Intent(this, (Class<?>) getIntent().getSerializableExtra("CALLING_CLASS"));
        intent.putExtras(getIntent());
        intent.putExtra("NEW_PLAYLIST", false);
        intent.putExtra("CALLED_FROM_FOOTER", true);
        intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        finish();
        startActivity(intent);
        return;
    } else {
        setContentView(R.layout.activity_now_playing_queue);
        final Fragment nowPlayingQueueFragment = new NowPlayingQueueFragment();
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add(R.id.now_playing_queue_container, nowPlayingQueueFragment, "nowPlayingQueueFragment");
        transaction.commit();
        SpannableString s = new SpannableString(getResources().getString(R.string.current_queue));
        s.setSpan(new TypefaceSpan(this, "RobotoCondensed-Light"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        // Update the action bar title with the TypefaceSpan instance.
        ActionBar actionBar = getActionBar();
        actionBar.setTitle(s);
        actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.holo_gray_selector));
    }
}
Also used : SpannableString(android.text.SpannableString) FragmentTransaction(android.support.v4.app.FragmentTransaction) Intent(android.content.Intent) DisplayMetrics(android.util.DisplayMetrics) Fragment(android.support.v4.app.Fragment) ActionBar(android.app.ActionBar) TypefaceSpan(com.jams.music.player.Utils.TypefaceSpan)

Example 2 with TypefaceSpan

use of com.jams.music.player.Utils.TypefaceSpan in project JamsMusicPlayer by psaravan.

the class PlaylistEditorActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.add_to_music_library, menu);
    ActionBar actionBar = getActionBar();
    SpannableString s = new SpannableString(getResources().getString(R.string.create_playlist));
    s.setSpan(new TypefaceSpan(this, "RobotoCondensed-Light"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    actionBar.setTitle(s);
    return super.onCreateOptionsMenu(menu);
}
Also used : SpannableString(android.text.SpannableString) MenuInflater(android.view.MenuInflater) ActionBar(android.app.ActionBar) TypefaceSpan(com.jams.music.player.Utils.TypefaceSpan)

Example 3 with TypefaceSpan

use of com.jams.music.player.Utils.TypefaceSpan in project JamsMusicPlayer by psaravan.

the class MusicLibraryEditorActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.add_to_music_library, menu);
    ActionBar actionBar = getActionBar();
    actionBar.setBackgroundDrawable(UIElementsHelper.getGeneralActionBarBackground(mContext));
    actionBar.setIcon(mContext.getResources().getIdentifier(libraryIconName, "drawable", mContext.getPackageName()));
    SpannableString s = new SpannableString(libraryName);
    s.setSpan(new TypefaceSpan(this, "RobotoCondensed-Light"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    actionBar.setTitle(s);
    return super.onCreateOptionsMenu(menu);
}
Also used : SpannableString(android.text.SpannableString) MenuInflater(android.view.MenuInflater) ActionBar(android.app.ActionBar) TypefaceSpan(com.jams.music.player.Utils.TypefaceSpan)

Example 4 with TypefaceSpan

use of com.jams.music.player.Utils.TypefaceSpan in project JamsMusicPlayer by psaravan.

the class BlacklistManagerActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.blacklist_manager, menu);
    ActionBar actionBar = getActionBar();
    actionBar.setBackgroundDrawable(UIElementsHelper.getGeneralActionBarBackground(mContext));
    SpannableString s = new SpannableString(getResources().getString(R.string.blacklist_manager));
    s.setSpan(new TypefaceSpan(this, "RobotoCondensed-Light"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    actionBar.setTitle(s);
    return super.onCreateOptionsMenu(menu);
}
Also used : SpannableString(android.text.SpannableString) MenuInflater(android.view.MenuInflater) ActionBar(android.app.ActionBar) TypefaceSpan(com.jams.music.player.Utils.TypefaceSpan)

Aggregations

ActionBar (android.app.ActionBar)4 SpannableString (android.text.SpannableString)4 TypefaceSpan (com.jams.music.player.Utils.TypefaceSpan)4 MenuInflater (android.view.MenuInflater)3 Intent (android.content.Intent)1 Fragment (android.support.v4.app.Fragment)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 DisplayMetrics (android.util.DisplayMetrics)1