android-actionbar

Both Fragment in ActionBar return true for fragment.isVisible()

不想你离开。 提交于 2019-12-25 09:22:13
问题 In my MainActivity with ActionBar I listen to a listener from a DialogFragment and based on which Fragment of ActionBar i am on, I need to do some things. I am using below code to get the current fragment and check which of the two ActionBar fragment i am on: private Fragment getVisibleFragment() { FragmentManager fragmentManager = getSupportFragmentManager(); List<Fragment> fragments = fragmentManager.getFragments(); if (fragments != null) { for (Fragment fragment : fragments) { if (fragment

Interface not reloaded after returning to app from BACK press

走远了吗. 提交于 2019-12-25 08:47:54
问题 I currently have a set of tabs, each tied to a fragment, and I've finally gotten the UI on one of the tabs to look how it should. Here's a screenshot of how the app looks when it has properly loaded (after initial launch and scrolling to a tab): Now, after I hit the back button (I haven't and won't be bothering with a backStack for each tab - I don't like that UI paradigm) and then use app switcher or relaunch from the launcher, my questionRows are gone (they don't reload). Do I need to

In Navigation drawer, how to refresh title and drawerlist when calling fragment from fragment?

无人久伴 提交于 2019-12-25 07:39:30
问题 I have a dumb question that I'm using navigation drawer for my android app. so everything works well so far. But now I need to call another fragment from a fragment. I can successfully replace the fragment, but i don't know how to change the actionbar title and drawer list selection. for example: in the drawerList i have "frag 1" and "frag 2" so in the MainActivity, i have selectitem(position) function to taking care of fragment replace, title change and also drawerlist selection change. So i

using Action Bar Android development

℡╲_俬逩灬. 提交于 2019-12-25 07:16:55
问题 I am new to android development. I am working on a small project, The title of the app is supposed to be in the center and a textview on the left side of the action bar. I would like to know if the approach is correct. 1. I have hidden the actionbar using ActionBar actionBar = getSupportActionBar(); actionBar.hide(); 2.I Developed a layout to replace the actionbar like this So is this the correct was of doing it ? If not, what's the correct way ? 回答1: Your way is correct but please go through

How to add an android Searchbar1 [duplicate]

假装没事ソ 提交于 2019-12-25 06:28:16
问题 This question already has answers here : Search bar widget in android? [closed] (3 answers) Closed 3 years ago . I was wondering if anyone could break down for me step by step how to add a searchbar in an activity . I have tried to look it up online but I couldn't really understand how it's done. 回答1: Add this dependency in your gradle : dependencies { compile 'com.miguelcatalan:materialsearchview:1.0.0' } Add this to your Mani Activity: <RelativeLayout android:id="@+id/toolbar_container"

Android Action Bar Style Generator : Change text color of action bar not available?

你离开我真会死。 提交于 2019-12-25 05:52:39
问题 I use "Android Action Bar Style Generator" website to generate styles for my actionBar. There is no possibility to change the text color of actionBar ? http://jgilfelt.github.io/android-actionbarstylegenerator/#name=RoseNormal&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutralPressed=1&backColor=e64260%2C100&secondaryColor=b8344c%2C100&tabColor=fff%2C100&tertiaryColor=F2F2F2%2C100&accentColor=33B5E5%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100 回答1: you

I can't split action bar in android

可紊 提交于 2019-12-25 05:13:57
问题 The action bar works, but I don't know why i can't split it in my app.. There's two activities, the splash screen comes first..,I don't know what's missing.. here's my manifest code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="example.paint" android:versionCode="1" android:versionName="1.0" > <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true"

android - menu item not showing in action bar

梦想与她 提交于 2019-12-25 04:33:22
问题 I'm trying to add menu item "done" in the action bar. I just copied and modified the code from another activity that has menu items showing. So it should work properly. Here's the activity layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout

SearchView in Actionbar Appcompat

时间秒杀一切 提交于 2019-12-25 04:17:31
问题 In my application, I am using Theme.AppCompat.Light.DarkActionBar but I am facing a weird problem. I have created SearchView in ActionBar and has set its property app:showAsAction="collapseActionView|ifRoom" but the SearchView is not expanded or collapsed on touch. menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/search" android:title="@string/search" android:icon="@android:drawable/ic_menu

Showing dividers between menu items in android actionbar

倖福魔咒の 提交于 2019-12-25 03:24:13
问题 I want show dividers between menu items in android actionbar Icon1 | Icon2 | icon3 my code for showing menu items is <item android:id="@+id/menu_time" android:icon="@drawable/action_time_btn_stateful" android:title="time" peel:showAsAction="always"/> <item android:id="@+id/menu_room_change" android:icon="@drawable/action_room_btn_stateful" android:title="change" peel:showAsAction="always"/> <item android:id="@+id/menu_like_set" android:icon="@drawable/like_button" android:title="Like" peel