android-appcompat

how to change actionbar's menu item text color in material design

ぃ、小莉子 提交于 2020-01-13 11:59:07
问题 I'm trying to update my notepad app to use Material Design, even on older devices. What i did so far: add library appcompat_v7 to my project, to support Material Design on older devices modify theme in AndroidManifest, adding android:theme="@style/Theme.NoteItTheme" to <application ... ></application> attributes creating the theme in /res/values/themes.xml: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="Theme

Center position of logo in Action Bar Android

烂漫一生 提交于 2020-01-12 07:56:12
问题 I want to display the logo at the centre of the Action Bar. Here's my custom layout code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ActionBarWrapper" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/logo" android:layout

Cannot instantiate class: android.support.v7.widget.SearchView

此生再无相见时 提交于 2020-01-12 06:35:09
问题 I´m trying to use a SearchView for my Application. First i added appcompat to my project: compile "com.android.support:appcompat-v7:19.0.1+" secound i add this code to my menu: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/action_search" android:title="@string/search" android:icon="@drawable/ic_action_search" android:showAsAction="ifRoom|collapseActionView" android:actionViewClass="android.support.v7.widget.SearchView" /> </menu> but when i start the

Using a Material-based Dialog Theme with AppCompat

会有一股神秘感。 提交于 2020-01-11 15:37:07
问题 I have an activity in my Manifest I used to style with a Dialog Theme. I can not find how to replace this in AppCompat library. <activity android:name=".LoginActivity" android:theme="@android:styles/Theme.Holo.Dialog" android:configChanges="orientation|screenSize|keyboardHidden" android:label="Login" > Is there a Material-based equivalent? 回答1: There is no material based theme for a dialog in AppCompat yet, see here Will appcompat automatically theme dialogs to look like the Lollipop version?

app:srcCompat - Vector drawable shows up in design preview, but doesn't show up in app

心不动则不痛 提交于 2020-01-11 09:10:12
问题 drawable/information.xml <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0,0 0,2 12A10,10 0,0 0,12 22A10,10 0,0 0,22 12A10,10 0,0 0,12 2Z"/> </vector> LayoutofCardView.xml <ImageView android:layout_width="24dp" android:background="#f00" android:layout_height="24dp" android:id="@

Tab not taking full width on Tablet device [Using android.support.design.widget.TabLayout]

蹲街弑〆低调 提交于 2020-01-08 18:20:15
问题 I have setup tabs as UPDATE 29/05/2015 this post. Tabs take full width on my Nexus 4 mobile but on nexus 7 tablet it in center and not cover full screen width. Nexus 7 screenshot Nexus 4 screenshot 回答1: A "simpler" answer borrowed from Kaizie would just be adding app:tabMaxWidth="0dp" in your TabLayout xml: <android.support.design.widget.TabLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMaxWidth="0dp" app:tabGravity="fill" app:tabMode="fixed" /> 回答2: I

Android Studio Appcompat conflict with ActionBarSherlock [duplicate]

本秂侑毒 提交于 2020-01-07 03:25:07
问题 This question already has answers here : Already Defined Error when building with gradle (2 answers) Closed 4 years ago . i try import eclipse project to android studio and get this error Error:(1) Attribute "titleTextStyle" has already been defined Error:(1) Attribute "subtitleTextStyle" has already been defined Error:(1) Attribute "divider" has already been defined Error:(1) Attribute "background" has already been defined Error:(1) Attribute "backgroundSplit" has already been defined Error:

Modify android theme from appcompat theme

送分小仙女□ 提交于 2020-01-06 13:36:46
问题 Is there any way to change an attribute from the stock android themes, if the App is using the AppCompat theme? My Problem: I am using AppCompat theme in order to get the L-Look. But I need to use the ActionMode, which is from basic Android API. If I change the ActionMode style within my AppCompat theme, the style for the SupportedActionMode is applied. But i defintily need the basic API ActionMode. Does anybody know a way how to do this, in order to style my ActionMode background? 回答1: Use

Spinner black text color in dark theme AppCompat v23

社会主义新天地 提交于 2020-01-06 01:45:14
问题 My theme extends from Theme.AppCompat but the text color is black like the background with the light theme works perfect this problem is only in API 10 (2.3.6) with above version works perfect. i use a AppCompatSpinner and my activity extends from AppCompatActivity 来源: https://stackoverflow.com/questions/32661614/spinner-black-text-color-in-dark-theme-appcompat-v23

Dumping AppCompat for API 21

和自甴很熟 提交于 2020-01-03 18:49:29
问题 So I'm creating an app that is Lollipop 5.0 API 21 and up with zero interest in supporting older devices. Do I still need the appcompat library when using Material Design like UI elements & layouting (sidebar aka nav bar, ink, etc) ? When stripping it down I often encounter crashes when trying to move away from the AppCompat stuff. Changing activity types from the AppCompat one to the Normal one, I end up with problems regarding dependencies on layout types like the coordinator layout that