how to change the icon on action bar in android - android-actionbar

I create a sliding menu and i want to open it using ( ... ) but i try alot to change the icon which is(<-).
this my code .
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer1, //nav menu toggle icon
R.string.app_name, // nav drawer open - description for accessibility
R.string.app_name // nav drawer close - description for accessibility
) {
public void onDrawerClosed(View view) {
getActionBar().setTitle("hello");
// calling onPrepareOptionsMenu() to show action bar icons
invalidateOptionsMenu();
}
public void onDrawerOpened(View drawerView) {
getActionBar().setTitle("ohhh");
// calling onPrepareOptionsMenu() to hide action bar icons
invalidateOptionsMenu();
}
};
// getSupportActionBar().setDisplayShowHomeEnabled(true);
// getActionBar().setHomeButtonEnabled(true);
//getSupportActionBar().setIcon(R.drawable.ic_drawer1);
getSupportActionBar().setIcon(R.drawable.ic_drawer1);
getSupportActionBar().setDisplayUseLogoEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

It has been asked already. Try to change in manifest file to change your app logo or if it doesn't work then try this link. Android: How to change the ActionBar "Home" Icon to be something other than the app icon?. This might help.

Related

Sitecore custom ribbon button not working

I have created a custom ribbon button following the steps mentioned in http://jondjones.com/how-to-add-a-custom-sitecore-button-to-the-editor-ribbon/
I can see the button appearing in sitecore:
Custom button
Command does not get triggered when clicked on the button.
Below is my code:
using System;
using Sitecore.Shell.Applications.Dialogs.ProgressBoxes;
using Sitecore.Shell.Framework.Commands;
namespace SitecoreVsPoc.Commands
{
public class TranslateContent : Command
{
private static readonly object Monitor = new object();
public override void Execute(CommandContext context)
{
if (context == null)
return;
try
{
ProgressBox.Execute("Arjun", "Title", "Applications/32x32/refresh.png", Refresh);
}
catch (Exception ex)
{
Sitecore.Diagnostics.Log.Error("Error!", ex, this);
}
}
public void Refresh(params object[] parameters)
{
// Do Stuff
}
}
}
Below is the command I have registered in commands.config:
<command name="contenteditor:translatecontent" type="SitecoreVsPoc.Commands.TranslateContent,SitecoreVsPoc" />
Note: I am using Sitecore 8.2 initial release.
Can someone suggest a solution for this?
In Sitecore 8 it was changed the way you add Ribbon button. As far I see your link is from Sitecore 7 or 6.
To create the new button item for the Experience Editor ribbon:
In the Core database, open the Content Editor and navigate to /sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Page Editor/Edit.
Create a new item based on the relevant ribbon control template, for example, the Small Button template. The templates are located at /sitecore/templates/System/Ribbon/.
For the new item, add the following information:
In the Header field, enter the display name of the button.
In the ID field, enter a unique identifier for the item. For example, you can include the ribbon group name in the ID.
In the Icon field, enter the path to the relevant icon. Depending on the button you create, adjust the icon size accordingly.
Open Sitecore Rocks and add the relevant control rendering, for example SmallButton, to the layout of the button item you created.
Enter a unique ID for the rendering.
For other SPEAK controls, you can point to another item in the Data Source field and specify the configuration in this other item.
Important
More informations you can find here: https://doc.sitecore.net/sitecore_experience_platform/content_authoring/the_editing_tools/the_experience_editor/customize_the_experience_editor_ribbon
http://reyrahadian.com/2015/04/15/sitecore-8-adding-edit-meta-data-button-in-experience-editor/
Before it was very simple, you didn't need to add new code:
https://blog.istern.dk/2012/05/21/running-sitecore-field-editor-from-a-command/

Smart Face ActionBar Menu Icon Too Small

SmartFace MenuItem Icon is not coming up properly, How do i get the actual size or customize the icon?
var productAdd = new SMF.UI.Android.MenuItem({
id:"productAdd",
//title:"Hide Me!",
icon: "ic_action_new.png",
showAsAction:SMF.UI.Android.ShowAsAction.always,
onSelected:function(e){
alert("Selected item id: " + e.id);
Pages.MainPage.visible = false; // hides the menu item when clicked.
}
});
for supporting every device first of all , all the resource folders should be filled.
You can read more about from http://www.smartface.io/developer/guides/project/anatomy-project
Also the icon Sizes are defined in the link belows;
http://iconhandbook.co.uk/reference/chart/android/
http://developer.android.com/design/style/iconography.html

How to hide propertysheet?

I had a propertysheet where I am facing an issue in hiding the sheet.I will briefly explain what I had done.
In the PropertySheet OnWizardFinish() I am trying hide the sheet and do the following ,
BOOL CSecondEditpage::OnWizardFinish()
{
BOOL bAsyRet = ShowWindowAsync(m_hWnd,SW_HIDE);
int MsgRet = ::MessageBox(NULL,L"Do you want to restart",L"Test",MB_YESNO | MB_ICONINFORMATION);
if(IDYES == MsgRet)
{
SystemRestart();
}
else
{
//Do Nothing..
}
return CPropertyPage::OnWizardFinish();
}
So here only the message box should be visible and the sheet should be hidden this is what I am expecting that ShowWindowAsync does.But in the background sheet still exists.
Same thing I tried with a dialog based application there it is working as expected like as,the background window is hidden and only message box is shown .
For more details:
And now when I click finish the sheet should be hidden and should show a message box something like this,
Can anyone please let me know how can achieve this in propertysheet wizard.
You're trying to hide PropertyPage not a PropertySheet.
Do like this.
CPropertySheet* prop = (CPropertySheet*)GetParent();
ShowWindowAsync(prop->m_hWnd, SW_HIDE);

MDI MFC VC++ how to switch views within mainframe

I am making MDI application , and without using splitter my document has multiple views. Now i want to change the document view from the MainFrame of an application...
here it is what i am doing , i have outlookbar with some menu buttons, when user will click those buttons then i will show CFormView inside the document as a child instead of popup dialog. Now i dont know how to change the view from MainFrame where the menu handler has been written.
Kindly suggest any tip if you know any...there are more than 5 different views and 4 of them are CFormView.
MainFrame ->MenuhandlerFunction (Menu Clicks)
MenuHandlerFunction -> Open New Document with New View Based on CFormView
(total 5 different CFormView and their handlers inside MainFrame Written)
I'm not very sure how you select which view to display, but here is some code to iterate through the views of the current document in your MainFrame:
EDIT: modified code for MDI
CMDIChildWnd *pChild = (CMDIChildWnd*)GetActiveFrame(); // EDIT: added line
CDocument *pDoc = pChild->GetActiveDocument(); // EDIT: added pChild->
POSITION pos = pDoc->GetFirstViewPosition();
while (pos != NULL)
{ CView* pView = GetNextView(pos);
// if this is the view you want to activate
// pChild->SetActiveView(pView); // EDIT: added pChild->
}

Can we create multiple action bar on the same activity on Android?

I want to create mutliple action bars (two) on the same activity for my Android App.
Here are my explanations:
I want a "header action bar" and a "footer action bar" to separate my menus :
one for options "Refresh" and "Settings"
and one for user actions "Send a post" and "Help".
Currently, I use this method:
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main_header, menu);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
return true;
}
My question is: how can I add another action bar and put it into the footer? It is possible?
(Example: http://i.stack.imgur.com/7sfh6.png)
Left image, action bar at the top (doesn't take into account the tab navigation) and the split Action Bar at the bottom.
I don't know what to say more, so if you want more informations you are free to ask me any questions.
Please have a look at uiOptions="splitActionBarWhenNarrow" option in manifest file: http://developer.android.com/guide/topics/manifest/application-element.html
Note: This was deprecated with Android 5.0: https://code.google.com/p/android/issues/detail?id=79722