Search in sources :

Example 21 with IconicsDrawable

use of com.mikepenz.iconics.IconicsDrawable in project LeafPic by HoraApps.

the class CustomPlayBackController method updatePlayPauseButton.

private void updatePlayPauseButton() {
    if (!isVisible() || !isAttachedToWindow) {
        return;
    }
    boolean playing = player != null && player.getPlayWhenReady();
    String contentDescription = getResources().getString(playing ? R.string.exo_controls_pause_description : R.string.exo_controls_play_description);
    playButton.setContentDescription(contentDescription);
    IconicsDrawable icon = playButton.getIcon();
    // icon.icon(playing ? CommunityMaterial.Icon.cmd_pause : CommunityMaterial.Icon.cmd_play);
    icon.icon(playing ? FontAwesome.Icon.faw_pause : FontAwesome.Icon.faw_play);
    // icon.icon(FontAwesome.Icon.faw_pause);
    playButton.setIcon(icon);
}
Also used : IconicsDrawable(com.mikepenz.iconics.IconicsDrawable)

Example 22 with IconicsDrawable

use of com.mikepenz.iconics.IconicsDrawable in project LeafPic by HoraApps.

the class SecurityActivity method setupUI.

private void setupUI() {
    setStatusBarColor();
    setNavBarColor();
    toolbar.setBackgroundColor(getPrimaryColor());
    setSupportActionBar(toolbar);
    toolbar.setNavigationIcon(new IconicsDrawable(this).icon(GoogleMaterial.Icon.gmd_arrow_back).color(Color.WHITE).sizeDp(19));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    toolbar.setTitle(getString(org.horaapps.leafpic.R.string.about));
    IconicsImageView imgActiveSecurity = (IconicsImageView) findViewById(org.horaapps.leafpic.R.id.active_security_icon);
    TextView txtActiveSecurity = (TextView) findViewById(org.horaapps.leafpic.R.id.active_security_item_title);
    TextView txtApplySecurity = (TextView) findViewById(org.horaapps.leafpic.R.id.security_body_apply_on);
    IconicsImageView imgApplySecurityHidden = (IconicsImageView) findViewById(org.horaapps.leafpic.R.id.security_body_apply_hidden_icon);
    TextView txtApplySecurityHidden = (TextView) findViewById(org.horaapps.leafpic.R.id.security_body_apply_hidden_title);
    IconicsImageView imgApplySecurityDelete = (IconicsImageView) findViewById(org.horaapps.leafpic.R.id.security_body_apply_delete_icon);
    TextView txtApplySecurityDelete = (TextView) findViewById(org.horaapps.leafpic.R.id.security_body_apply_delete_title);
    CardView securityDialogCard = (CardView) findViewById(org.horaapps.leafpic.R.id.security_dialog_card);
    llroot.setBackgroundColor(getBackgroundColor());
    securityDialogCard.setCardBackgroundColor(getCardBackgroundColor());
    /*ICONS*/
    int color = getIconColor();
    imgActiveSecurity.setColor(color);
    imgApplySecurityHidden.setColor(color);
    imgApplySecurityDelete.setColor(color);
    /*TEXTVIEWS*/
    color = getTextColor();
    txtActiveSecurity.setTextColor(color);
    txtApplySecurity.setTextColor(color);
    txtApplySecurityHidden.setTextColor(color);
    txtApplySecurityDelete.setTextColor(color);
}
Also used : IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) IconicsDrawable(com.mikepenz.iconics.IconicsDrawable) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) View(android.view.View)

Example 23 with IconicsDrawable

use of com.mikepenz.iconics.IconicsDrawable in project LeafPic by HoraApps.

the class DonateActivity method setTheme.

private void setTheme() {
    /**** ToolBar *****/
    toolbar.setBackgroundColor(getPrimaryColor());
    setSupportActionBar(toolbar);
    toolbar.setNavigationIcon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_arrow_left).color(Color.WHITE).sizeDp(19));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    toolbar.setTitle(getString(org.horaapps.leafpic.R.string.donate));
    setStatusBarColor();
    setNavBarColor();
    setRecentApp(getString(org.horaapps.leafpic.R.string.donate));
    final Button btnDonateIap = (Button) findViewById(R.id.button_donate_play_store);
    btnDonateIap.setText(String.format("%s %d€", getString(R.string.donate).toUpperCase(), progress));
    themeSeekBar(bar);
    bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
            if (i == 0)
                progress = 2;
            else
                progress = (i + 1) * 2;
            btnDonateIap.setText(String.format("%s %d€", getString(R.string.donate).toUpperCase(), progress));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    /**** Title Cards ***/
    ((TextView) findViewById(org.horaapps.leafpic.R.id.team_name)).setTextColor(getAccentColor());
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item_title)).setTextColor(getAccentColor());
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_item_title)).setTextColor(getAccentColor());
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item_title)).setTextColor(getAccentColor());
    /** BackGround **/
    findViewById(org.horaapps.leafpic.R.id.donate_background).setBackgroundColor(getBackgroundColor());
    /** Cards **/
    int color = getCardBackgroundColor();
    ((CardView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_card)).setCardBackgroundColor(color);
    ((CardView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_card)).setCardBackgroundColor(color);
    ((CardView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_card)).setCardBackgroundColor(color);
    ((CardView) findViewById(org.horaapps.leafpic.R.id.donate_header_card)).setCardBackgroundColor(color);
    /** Icons **/
    color = getIconColor();
    ((IconicsImageView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_icon_title)).setColor(color);
    ((IconicsImageView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_icon_title)).setColor(color);
    ((IconicsImageView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_icon_title)).setColor(color);
    ((IconicsImageView) findViewById(org.horaapps.leafpic.R.id.donate_header_icon)).setColor(color);
    /** TextViews **/
    color = getTextColor();
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item)).setTextColor(color);
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_paypal_item)).setTextColor(color);
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item)).setTextColor(color);
    ((TextView) findViewById(org.horaapps.leafpic.R.id.donate_header_item)).setTextColor(color);
    /***** ScrolView *****/
    setScrollViewColor(scr);
    /** ACTIONS **/
    findViewById(org.horaapps.leafpic.R.id.button_donate_paypal).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            cts.launchUrl("https://www.paypal.me/HoraApps");
        }
    });
    findViewById(org.horaapps.leafpic.R.id.donate_bitcoin_item).setOnLongClickListener(new View.OnLongClickListener() {

        @Override
        public boolean onLongClick(View v) {
            ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
            ClipData clip = ClipData.newPlainText("Copied to Clipboard", ((TextView) v).getText());
            clipboard.setPrimaryClip(clip);
            StringUtils.showToast(getApplicationContext(), getString(org.horaapps.leafpic.R.string.address_copied));
            return true;
        }
    });
    findViewById(R.id.button_donate_play_store).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (mHelper != null)
                mHelper.flagEndAsync();
            mHelper.launchPurchaseFlow(DonateActivity.this, "donation_" + progress, 123, new IabHelper.OnIabPurchaseFinishedListener() {

                @Override
                public void onIabPurchaseFinished(IabResult result, Purchase info) {
                    mHelper.consumeAsync(info, mPurchaseFinishedListener);
                }
            });
        }
    });
}
Also used : ClipboardManager(android.content.ClipboardManager) Purchase(org.horaapps.leafpic.util.inapppurchase.Purchase) SeekBar(android.widget.SeekBar) CardView(android.support.v7.widget.CardView) IabResult(org.horaapps.leafpic.util.inapppurchase.IabResult) CardView(android.support.v7.widget.CardView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) View(android.view.View) IconicsImageView(com.mikepenz.iconics.view.IconicsImageView) Button(android.widget.Button) TextView(android.widget.TextView) IconicsDrawable(com.mikepenz.iconics.IconicsDrawable) ClipData(android.content.ClipData)

Example 24 with IconicsDrawable

use of com.mikepenz.iconics.IconicsDrawable in project MaterialDrawer by mikepenz.

the class PersistentDrawerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_persistent_drawer);
    //Remove line to test RTL support
    // getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
    //example how to implement a persistentDrawer as shown in the google material design guidelines
    //https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0Bx4BSt6jniD7YVdKQlF3TEo2S3M/patterns_navdrawer_behavior_persistent2.png
    //https://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-behavior
    // Handle Toolbar
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(R.string.drawer_item_persistent_compact_header);
    // Create a few sample profile
    final IProfile profile = new ProfileDrawerItem().withName("Mike Penz").withEmail("mikepenz@gmail.com").withIcon(R.drawable.profile);
    final IProfile profile2 = new ProfileDrawerItem().withName("Max Muster").withEmail("max.mustermann@gmail.com").withIcon(R.drawable.profile2);
    final IProfile profile3 = new ProfileDrawerItem().withName("Felix House").withEmail("felix.house@gmail.com").withIcon(R.drawable.profile3);
    final IProfile profile4 = new ProfileDrawerItem().withName("Mr. X").withEmail("mister.x.super@gmail.com").withIcon(R.drawable.profile4);
    final IProfile profile5 = new ProfileDrawerItem().withName("Batman").withEmail("batman@gmail.com").withIcon(R.drawable.profile5);
    // Create the AccountHeader
    headerResult = new AccountHeaderBuilder().withActivity(this).withCompactStyle(true).withTranslucentStatusBar(true).withHeaderBackground(new ColorDrawable(Color.parseColor("#FDFDFD"))).withHeightPx(UIUtils.getActionBarHeight(this)).withAccountHeader(R.layout.material_drawer_compact_persistent_header).withTextColor(Color.BLACK).addProfiles(profile, profile2, profile3, profile4, profile5).withSavedInstance(savedInstanceState).build();
    //Create the drawer
    result = new DrawerBuilder().withActivity(this).withTranslucentStatusBar(true).withAccountHeader(//set the AccountHeader we created earlier for the header
    headerResult).addDrawerItems(new PrimaryDrawerItem().withName(R.string.drawer_item_home).withIcon(FontAwesome.Icon.faw_home).withIdentifier(1), new PrimaryDrawerItem().withName(R.string.drawer_item_free_play).withIcon(FontAwesome.Icon.faw_gamepad), new PrimaryDrawerItem().withName(R.string.drawer_item_custom).withIcon(FontAwesome.Icon.faw_eye), new SectionDrawerItem().withName(R.string.drawer_item_section_header), new SecondaryDrawerItem().withName(R.string.drawer_item_settings).withIcon(FontAwesome.Icon.faw_cog), new SecondaryDrawerItem().withName(R.string.drawer_item_help).withIcon(FontAwesome.Icon.faw_question).withEnabled(false), new SecondaryDrawerItem().withName(R.string.drawer_item_open_source).withIcon(FontAwesome.Icon.faw_github), new SecondaryDrawerItem().withName(R.string.drawer_item_contact).withIcon(FontAwesome.Icon.faw_bullhorn)).withGenerateMiniDrawer(true).withSavedInstance(savedInstanceState).buildView();
    // create the MiniDrawer and define the drawer and header to be used (it will automatically use the items from them)
    miniResult = result.getMiniDrawer().withIncludeSecondaryDrawerItems(true);
    //set the back arrow in the toolbar
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(false);
    //get the widths in px for the first and second panel
    int firstWidth = (int) com.mikepenz.crossfader.util.UIUtils.convertDpToPixel(300, this);
    int secondWidth = (int) com.mikepenz.crossfader.util.UIUtils.convertDpToPixel(72, this);
    //create and build our crossfader (see the MiniDrawer is also builded in here, as the build method returns the view to be used in the crossfader)
    crossFader = new Crossfader().withContent(findViewById(R.id.crossfade_content)).withFirst(result.getSlider(), firstWidth).withSecond(miniResult.build(this), secondWidth).withSavedInstance(savedInstanceState).build();
    //define the crossfader to be used with the miniDrawer. This is required to be able to automatically toggle open / close
    miniResult.withCrossFader(new CrossfadeWrapper(crossFader));
    //define and create the arrow ;)
    ImageView toggle = (ImageView) headerResult.getView().findViewById(R.id.material_drawer_account_header_toggle);
    //for RTL you would have to define the other arrow
    toggle.setImageDrawable(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_chevron_left).sizeDp(16).color(Color.BLACK));
    toggle.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            crossFader.crossFade();
        }
    });
}
Also used : PrimaryDrawerItem(com.mikepenz.materialdrawer.model.PrimaryDrawerItem) ProfileDrawerItem(com.mikepenz.materialdrawer.model.ProfileDrawerItem) AccountHeaderBuilder(com.mikepenz.materialdrawer.AccountHeaderBuilder) SecondaryDrawerItem(com.mikepenz.materialdrawer.model.SecondaryDrawerItem) ImageView(android.widget.ImageView) View(android.view.View) SectionDrawerItem(com.mikepenz.materialdrawer.model.SectionDrawerItem) ColorDrawable(android.graphics.drawable.ColorDrawable) CrossfadeWrapper(com.mikepenz.materialdrawer.app.utils.CrossfadeWrapper) ImageView(android.widget.ImageView) IProfile(com.mikepenz.materialdrawer.model.interfaces.IProfile) DrawerBuilder(com.mikepenz.materialdrawer.DrawerBuilder) IconicsDrawable(com.mikepenz.iconics.IconicsDrawable) Toolbar(android.support.v7.widget.Toolbar) Crossfader(com.mikepenz.crossfader.Crossfader)

Example 25 with IconicsDrawable

use of com.mikepenz.iconics.IconicsDrawable in project MaterialDrawer by mikepenz.

the class OverflowMenuDrawerItem method bindView.

@Override
public void bindView(ViewHolder viewHolder, List payloads) {
    super.bindView(viewHolder, payloads);
    Context ctx = viewHolder.itemView.getContext();
    //bind the basic view parts
    bindViewHelper(viewHolder);
    //handle menu click
    viewHolder.menu.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            PopupMenu popup = new PopupMenu(view.getContext(), view);
            MenuInflater inflater = popup.getMenuInflater();
            inflater.inflate(mMenu, popup.getMenu());
            popup.setOnMenuItemClickListener(mOnMenuItemClickListener);
            popup.setOnDismissListener(mOnDismissListener);
            popup.show();
        }
    });
    //handle image
    viewHolder.menu.setImageDrawable(new IconicsDrawable(ctx, GoogleMaterial.Icon.gmd_more_vert).sizeDp(12).color(getIconColor(ctx)));
    //call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
    onPostBindView(this, viewHolder.itemView);
}
Also used : Context(android.content.Context) MenuInflater(android.view.MenuInflater) View(android.view.View) IconicsDrawable(com.mikepenz.iconics.IconicsDrawable) PopupMenu(android.support.v7.widget.PopupMenu)

Aggregations

IconicsDrawable (com.mikepenz.iconics.IconicsDrawable)31 View (android.view.View)14 MenuInflater (android.view.MenuInflater)9 Toolbar (android.support.v7.widget.Toolbar)7 SearchView (android.support.v7.widget.SearchView)6 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)6 DrawerBuilder (com.mikepenz.materialdrawer.DrawerBuilder)6 SecondaryDrawerItem (com.mikepenz.materialdrawer.model.SecondaryDrawerItem)6 Intent (android.content.Intent)5 RecyclerView (android.support.v7.widget.RecyclerView)5 ProfileDrawerItem (com.mikepenz.materialdrawer.model.ProfileDrawerItem)5 Context (android.content.Context)4 AccountHeaderBuilder (com.mikepenz.materialdrawer.AccountHeaderBuilder)4 Drawer (com.mikepenz.materialdrawer.Drawer)4 PrimaryDrawerItem (com.mikepenz.materialdrawer.model.PrimaryDrawerItem)4 SectionDrawerItem (com.mikepenz.materialdrawer.model.SectionDrawerItem)4 IDrawerItem (com.mikepenz.materialdrawer.model.interfaces.IDrawerItem)4 IProfile (com.mikepenz.materialdrawer.model.interfaces.IProfile)4 Drawable (android.graphics.drawable.Drawable)3