android-actionbar

Remove pressed effect on action bar home icon

对着背影说爱祢 提交于 2019-12-05 06:29:56
问题 First, a few words about the app : minimum level is 16, I use a DrawerLayout (with the indicator) and have changed the background of my ActionBar. When clicking on the home button to open the drawer, there is a blue pressed effect on both the image and the drawer indicator, that I'd like to remove. I tried setting selectableItemBackground in the styles to transparent, nearly everywhere I could think of, but that doesn't seem to change anything. Do anyone have a solution ? Here is the image of

Android Tab Action Bar

会有一股神秘感。 提交于 2019-12-05 06:20:40
I am trying out on the android action bar for 3.0, where I refer to http://www.youtube.com/watch?v=gMu8XhxUBl8 The code in the TabsActivity are as follow: package com.test.actionbar; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; public class TabsActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

Android: ActionBar, TabListener and support.v4.Fragment

梦想与她 提交于 2019-12-05 05:51:55
I'm building an app with MainActivity which extends FragmentActivity and has an ActionBar with three tabs. At each tab I would like to attach a ParentFragment which should control the swipe among internal pages. The result should be that pressing the tabs the user should change from the different instances of the ParentFragment and swiping he should change among the TextViewFragments inside each ParentFragment . Now I can perfectly switch among the three tabs, but the problem is that the ParentFragment is not correctly shown, it seems it's not even created because I can't even see the onCreate

What is the ID of the back arrow drawable in the ActionBar?

試著忘記壹切 提交于 2019-12-05 05:34:41
The following code causes a back arrow to appear in the ActionBar: getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); I'm looking for the resource ID of the arrow drawable, i.e. android.R.drawable.xxx. The reason I need this ID is so that I can manually set an identical arrow (size & colour) elsewhere in my app. I tried making my own drawable and using that but the size was different from the one in the ActionBar. If you have the support library in your project, you can make a back button in any place in your applicaction like this:

ActionBarSherlock: open submenu with menu button

邮差的信 提交于 2019-12-05 05:25:37
I'm using ActionBarSherlock-4.1.0-0 and I would like to open my submenu in the Actionbar with the hardware menu button. I'm planing an update and in my old version I used the "normal" menu. I'd like to help users to get used to the new design. I got the submenu and the main-menu: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater i = getSupportMenuInflater(); i.inflate(R.menu.main_menu, menu); SubMenu subMenu = (SubMenu) menu.findItem(R.id.actionbar_submenu); Menu mainMenu = menu; return super.onCreateOptionsMenu(menu); } and i got a listner to the hardware menu button:

Hide or remove Action Bar on specific Activity | Android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 04:58:53
How I can remove Action Bar on specific activity not for all application, for example I have Sign Up activity and for this activity I want to remove Action Bar In your AndroidManifest.xml use NoActionBar theme for your Activity like this: <activity android:name=".SignUpActivity" android:theme="@style/AppTheme.NoActionBar"/> and in your styles.xml <style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> from within your activity: getActionBar().hide(); or getSupportActionBar().hide(); I would suggest to migrate to ToolBar, new

Show menu items depending ViewPager Android

眉间皱痕 提交于 2019-12-05 02:50:35
问题 I have a ViewPager with fragments in my Android app. I want to show Action Bar menu item depending the fragment of the ViewPager. I have readen some questions about this but I can´t find the correct solution. My ViewPager´s code is this: public class My_Activity extends ActionBarActivity { private ViewPager mViewPager; String idioma; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_main); ActionBar actionBar =

How to implement an action bar like google maps

余生长醉 提交于 2019-12-05 02:31:03
问题 I've been looking around but I can't seem to find out how to implement an action bar that looks like the one in Google maps and Google now. Can anyone give me a link to a documentation/tutorial or at least the name of that type of action bar? Edit:I've attached a picture of what i want the action bar to look like 回答1: Okay I've solved this myself. I hid the default actionbar and used XML to create the custom actionbar(using linearlayout, EditText and Buttons). 来源: https://stackoverflow.com

ActionBarCompat - App icon action (click) not working on 4.0 devices

浪子不回头ぞ 提交于 2019-12-05 02:16:08
I have this problem with the Android ActionBarCompat project: On emulators with Android 4.0 the click on the app icon doesn't cause any onOptionsItemSelected event, whereas it works on all other OS versions. Any input is greatly appreciated! Are you seeing any touch feedback from the app icon? (Does it glow when you press it?) Since many activities do not use the action bar home button, in apps that target API 14+ running on Android 4.0 it is disabled by default. (This is so that users don't try pressing it, see it glow, and wonder why nothing happened.) Apps that want to use this should call

Navigation Drawer icon not showing android

荒凉一梦 提交于 2019-12-05 01:55:21
问题 MainActivity.java public class MainActivity extends FragmentActivity { public DrawerLayout mDrawerLayout; public ListView mDrawerList; public ActionBarDrawerToggle mDrawerToggle; // nav drawer title public CharSequence mDrawerTitle; // used to store app title public CharSequence mTitle; // slide menu items public String[] navMenuTitles; public TypedArray navMenuIcons; public ArrayList<NavDrawerItem> navDrawerItems; public NavDrawerListAdapter adapter; ActionBar actionBar; TextView tvTitle,