Java Code Examples for android.widget.IconTextView

The following are top voted examples for showing how to use android.widget.IconTextView. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: spotify-tv   File: ControlPresenter.java   View source code 6 votes vote down vote up
@Override
public void onBindViewHolder(ViewHolder viewHolder, Object item) {
    ControlView controlView = (ControlView) viewHolder.view;
    Control control = (Control) item;

    controlView.setControl(control);
    IconTextView fontIconIV = controlView.getIconTextView();
    fontIconIV.setText(control.getFontId(), TextView.BufferType.NORMAL);

    boolean isOn;
    if (control == Control.SHUFFLE) {
        isOn = SpotifyTvApplication.getInstance().getSpotifyPlayerController().isShuffleOn();
    } else {
        isOn = false;
    }
    controlView.toggleControlColor(isOn);
}
 
Example 2
Project: RecifeBomDeBola   File: ContactFragment.java   View source code 6 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_contact, container, false);
    View header = inflater.inflate(R.layout.list_header_contact, null, false);
    ButterKnife.bind(this, root);

    IconTextView iconWebSite = (IconTextView) header.findViewById(android.R.id.icon1);
    IconTextView iconEmail = (IconTextView) header.findViewById(android.R.id.icon2);
    TextView webSite = (TextView) header.findViewById(R.id.website);
    TextView email = (TextView) header.findViewById(R.id.email);
    iconWebSite.setTypeface(Iconify.getTypeface(getActivity()));
    iconEmail.setTypeface(Iconify.getTypeface(getActivity()));
    webSite.setText(App.SITE_URL.replace("http://", ""));
    email.setText(App.CONTACT_EMAIL);

    listView.addHeaderView(header);
    listView.setAdapter(new ContactAdapter(getActivity(), Db.contacts));
    return root;
}
 
Example 3
Project: mathtools   File: MainFragment.java   View source code 6 votes vote down vote up
@Override
public void setupInnerViewElements(ViewGroup parent, View view) {

    // Retrieve elements
    mTitle = (TextView) parent.findViewById(R.id.carddemo_myapps_main_inner_title);
    IconTextView iTV = (IconTextView) parent.findViewById(R.id.card_icon);

    if (mTitle != null)
        mTitle.setText(title);

    if (iTV != null) {
        iTV.setText(getText(iconTextViewTextResource));
        iTV.setTextColor(iconTextViewTextColor);
    }

}
 
Example 4
Project: spotify-tv   File: SettingView.java   View source code 5 votes vote down vote up
private void init() {
    setOrientation(VERTICAL);
    int size = getResources().getDimensionPixelSize(R.dimen.setting_view_size);
    setLayoutParams(new ViewGroup.LayoutParams(size, size));
    setBackgroundColor(getResources().getColor(R.color.setting_bg));
    setFocusable(true);
    setFocusableInTouchMode(true);
    setGravity(Gravity.CENTER);

    inflate(getContext(), R.layout.setting_view, this);

    mIconTextView = (IconTextView) findViewById(R.id.setting_icon);
    mTitleTV = (TextView) findViewById(R.id.setting_title);
}
 
Example 5
Project: RecifeBomDeBola   File: Util.java   View source code 5 votes vote down vote up
public static void openPlayersDialog(final Activity activity, final String teamName, String teamCategory, int teamRpa){
    Db.getTeamPlayers(activity, teamName, teamCategory, teamRpa, new FindCallback<Player>() {
        @Override
        public void done(final List<Player> list, ParseException e) {
            final View playersView = activity.getLayoutInflater().inflate(R.layout.dialog_players, null, false);
            final ListView playersList = (ListView) playersView.findViewById(android.R.id.list);
            IconTextView redCardsView = (IconTextView) playersView.findViewById(R.id.red_cards);
            IconTextView yellowCardsView = (IconTextView) playersView.findViewById(R.id.yellow_cards);

            redCardsView.setTypeface(Iconify.getTypeface(activity));
            yellowCardsView.setTypeface(Iconify.getTypeface(activity));

            ParseObject.pinAllInBackground(list);
            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    playersList.setAdapter(new PlayerAdapter(activity, list));

                 final NiftyDialogBuilder playerDialog = NiftyDialogBuilder.getInstance(activity);
                    playerDialog.setCustomView(playersView, activity)
                            .withTitle(teamName)
                            .withMessage(null)
                            .withDuration(300)
                            .withEffect(Effectstype.Fadein)
                            .withDialogColor(activity.getResources().getColor(R.color.primary_dark))
                            .withTitleColor(activity.getResources().getColor(R.color.accent))
                            .withButton1Text(activity.getString(R.string.close))
                            .setButton1Click(new View.OnClickListener() {
                             @Override
                             public void onClick(View v) {
                              playerDialog.dismiss();
                             }
                            });
                 playerDialog.show();
                }
            });
        }
    });
}
 
Example 6
Project: Cotable   File: DrawerMenuHolder.java   View source code 4 votes vote down vote up
public DrawerMenuHolder(View view) {
    mIconTextView = (IconTextView) view.findViewById(R.id.drawer_left_list_item_icon);
    mTextView = (TextView) view.findViewById(R.id.drawer_left_list_item_text);
}
 
Example 7
Project: Cotable   File: DrawerMenuHolder.java   View source code 4 votes vote down vote up
public IconTextView getIconTextView() {
    return mIconTextView;
}
 
Example 8
Project: spotify-tv   File: ControlView.java   View source code 4 votes vote down vote up
private void init() {
    inflate(getContext(), R.layout.control_view, this);
    mIconTextView = (IconTextView) findViewById(R.id.control_icon);
    toggleControlColor(false);
}
 
Example 9
Project: spotify-tv   File: ControlView.java   View source code 4 votes vote down vote up
public IconTextView getIconTextView() {
    return mIconTextView;
}
 
Example 10
Project: RecifeBomDeBola   File: Util.java   View source code 4 votes vote down vote up
public static View getEmptyView(Activity activity){
    View emptyView = activity.getLayoutInflater().inflate(R.layout.empty, null);
    IconTextView iconView = (IconTextView) emptyView.findViewById(android.R.id.icon);
    iconView.setTypeface(Iconify.getTypeface(activity));
    return emptyView;
}
 
Example 11
Project: LocalMusicPlayer   File: StartActivity.java   View source code 4 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    MusicService.MusicBinder binder = (MusicService.MusicBinder) service;
    // Get service
    musicService = binder.getService();
    // Pass song list
    musicService.setSongs(songList);
    musicService.setUIControls(seekBar, currentPosition, totalDuration);
    musicBound = true;

    // If we don't have any songs on SD, tell the user about that
    if (songList.size() == 0)
        findViewById(R.id.no_music).setVisibility(View.VISIBLE);

    // Initialize interfaces
    musicService.setOnSongChangedListener(new MusicService.OnSongChangedListener() {
        ImageView artworkView = (ImageView) findViewById(R.id.playerArtwork);
        ImageView previewArtworkView = (ImageView) findViewById(R.id.previewArtwork);
        TextView previewSongTitle = (TextView) findViewById(R.id.previewSongTitle);
        TextView previewSongArtist = (TextView) findViewById(R.id.previewSongArtist);
        IconTextView previewPlayBtn = (IconTextView) findViewById(R.id.previewPlayBtn);
        @Override
        public void onSongChanged(Song song) {
            Bitmap bitmap;
            previewSongTitle.setText(song.getTitle());
            previewSongArtist.setText(song.getArtist());
            bitmap = song.getArtworkBitmap(getApplicationContext());
            if (bitmap == null) return; // bitmap might be null.. if it is, dont do anything
            artworkView.setImageBitmap(bitmap);
            previewArtworkView.setImageBitmap(bitmap);

            Bitmap blurredBitmap = bitmap.copy(bitmap.getConfig(), true);

            applyBlur(25f, blurredBitmap);

            // Scale the bitmap
            Matrix matrix = new Matrix();
            matrix.postScale(3f, 3f);
            blurredBitmap = Bitmap.createBitmap(blurredBitmap, 0, 0, blurredBitmap.getWidth(), blurredBitmap.getHeight(), matrix, true);
            ((ImageView) findViewById(R.id.playerBg)).setImageBitmap(blurredBitmap);
        }

        @Override
        public void onPlayerStatusChanged(int status) {
            switch(status) {
                case MusicService.PLAYING:
                    previewPlayBtn.setText("{fa-pause}");
                    fab.setImageDrawable(new IconDrawable(getApplicationContext(), Iconify.IconValue.fa_pause)
                            .colorRes(R.color.dark));
                    break;
                case MusicService.PAUSED:
                    previewPlayBtn.setText("{fa-play}");
                    fab.setImageDrawable(new IconDrawable(getApplicationContext(), Iconify.IconValue.fa_play)
                            .colorRes(R.color.dark));
                    break;
            }
        }
    });

    musicService.setSong(0);
}