android-actionbar

Override an attribute in a theme

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 10:25:29
问题 I'm having trouble styling a theme for my app. I use Material theme as following <style name="Theme.KhoaLuanTotNghiep" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to custom the theme so that the action bar's color is white and title bar text is black. I have traced the inheritance to change the action bar's color but I cant change the color for the title text. This is what I have done: extends the action bar and change its attributes <style name="Widget.App.ActionBar"

Adding text below/above a switch button in Android menu icon

浪尽此生 提交于 2021-01-29 04:53:57
问题 I am trying to add a text below/above this switch item that is in my Toolbar to indicate functionality of the switch. I was wondering if there is a layout tag I could use to add a text below/above the button. Or is there some other method I have to use. menu_main.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> <item android:id="@+id/edit"

SearchView in ActionBar using Fragments

只愿长相守 提交于 2021-01-29 01:31:16
问题 I have a navigation drawer in HomeActivity. Inside the navigation I have fragments that contain different RecycleViews each. I want to implement SearchView in ActionBar so it will search in the RecycleView according to the active fragment. This is on of the fragments code: public class HomeFragment extends Fragment { private static BackEnd backEnd; private RecyclerView rvBooks; private BookAdapter adapter; private MenuItem mSearchAction; private SearchView searchView; private ActionBar

Is there anyway to get the position of android menubar item?

﹥>﹥吖頭↗ 提交于 2021-01-28 10:29:53
问题 I need to load Android dialog activity window once clicked on the icon in the action bar as displayed in the following image: I know how to load the window using the following code. resolver=getContentResolver(); layoutParams=getWindow().getAttributes(); layoutParams.x=400; layoutParams.height=600; layoutParams.width=1000; layoutParams.y= 30; this.getWindow().setAttributes(layoutParams); What I need to know is if there is any way to find out the position of the icon in action bar, without

Is there anyway to get the position of android menubar item?

白昼怎懂夜的黑 提交于 2021-01-28 10:27:22
问题 I need to load Android dialog activity window once clicked on the icon in the action bar as displayed in the following image: I know how to load the window using the following code. resolver=getContentResolver(); layoutParams=getWindow().getAttributes(); layoutParams.x=400; layoutParams.height=600; layoutParams.width=1000; layoutParams.y= 30; this.getWindow().setAttributes(layoutParams); What I need to know is if there is any way to find out the position of the icon in action bar, without

ActionBar background with MaterialComponents theme

扶醉桌前 提交于 2021-01-27 05:29:33
问题 I want to customize my ActionBar. My Theme looks as below: <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@style/ThemeOverlay.MaterialComponents.ActionBar"> <item name="background">@drawable/actionBarBackground</item> </style> In values folder: <drawable name="actionBarBackground">#FFFFFFFF</drawable> In values-night folder: <drawable name="actionBarBackground">#FF000000<

Android: Add searchView on the Action Bar

…衆ロ難τιáo~ 提交于 2020-12-31 14:50:33
问题 My Complete Project Is As Follows: There is a listView connnected to database and a search option with suggestion . I wanna shift this search bar to the action bar and format it just like Google Play Store Search bar . Please help me, my complete codes are: MainActivity.java package com.GurbaniAndSikh.MahaanKosh; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7

Android: Add searchView on the Action Bar

筅森魡賤 提交于 2020-12-31 14:48:46
问题 My Complete Project Is As Follows: There is a listView connnected to database and a search option with suggestion . I wanna shift this search bar to the action bar and format it just like Google Play Store Search bar . Please help me, my complete codes are: MainActivity.java package com.GurbaniAndSikh.MahaanKosh; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7

How to set ActionBar for transaparent and keep it over ImageView

大城市里の小女人 提交于 2020-12-02 00:23:04
问题 I want to make the ActionBar transparent and it above the image like this picture. How set it? 回答1: Layout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/background_white" android:minHeight="?attr/actionBarSize" /> <FrameLayout

How to set ActionBar for transaparent and keep it over ImageView

瘦欲@ 提交于 2020-12-02 00:04:10
问题 I want to make the ActionBar transparent and it above the image like this picture. How set it? 回答1: Layout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/background_white" android:minHeight="?attr/actionBarSize" /> <FrameLayout