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);
}
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);
}
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);
}
});
}
});
}
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();
}
});
}
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);
}
Aggregations