Java 类android.widget.IconTextView 实例源码

项目:spotify-tv    文件:ControlPresenter.java   
@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);
}
项目:RecifeBomDeBola    文件:ContactFragment.java   
@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;
}
项目:mathtools    文件:MainFragment.java   
@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);
    }

}
项目:spotify-tv    文件:SettingView.java   
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);
}
项目:RecifeBomDeBola    文件:Util.java   
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();
                }
            });
        }
    });
}
项目:Cotable    文件:DrawerMenuHolder.java   
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);
}
项目:Cotable    文件:DrawerMenuHolder.java   
public IconTextView getIconTextView() {
    return mIconTextView;
}
项目:spotify-tv    文件:ControlView.java   
private void init() {
    inflate(getContext(), R.layout.control_view, this);
    mIconTextView = (IconTextView) findViewById(R.id.control_icon);
    toggleControlColor(false);
}
项目:spotify-tv    文件:ControlView.java   
public IconTextView getIconTextView() {
    return mIconTextView;
}
项目:RecifeBomDeBola    文件:Util.java   
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;
}
项目:LocalMusicPlayer    文件:StartActivity.java   
@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);
}