negusoft / holoaccent Goto Github PK
View Code? Open in Web Editor NEWAndroid library to customize the Holo theme with a custom accent color
License: Apache License 2.0
Android library to customize the Holo theme with a custom accent color
License: Apache License 2.0
The ColoredActionBar
style makes app look great and is really useful when we need to customize app to make it different from default Holo (Dark, Light) theme.
Sometimes I use ColoredActionBar
with 'Light' theme to make app looks brighter. However, I also want to keep ActionBar title & subtitle is white instead of dark.
So, could you please add a new theme Light/Dark ColoredActionBar TitleInverse
which make title&subtitle text color is the same as current theme?
As I see in Android ActionBar Style Generator (http://jgilfelt.github.io/android-actionbarstylegenerator), we can customize menu item background (is "Popup color" section in above link).
But in HoloAccent, although I choose a custom color but background of Menu item still is holo color (#33b5e5
).
I don't know if it's possible to do this with HoloAccent?
Hi there, quick question : is there any plan of adding the sliding left menu style that we can see more and more everywhere to the App template?
I got the following exception on at least three different devices:
Caused by: java.lang.StackOverflowError
at com.negusoft.holoaccent.AccentResources.checkInitialized(AccentResources.java:148)
at com.negusoft.holoaccent.AccentResources.getColor(AccentResources.java:214)
at android.content.res.TypedArray.getThemeColor(TypedArray.java:751)
at android.content.res.TypedArray.getColor(TypedArray.java:319)
at com.negusoft.holoaccent.AccentResources.initPalette(AccentResources.java:179)
at com.negusoft.holoaccent.AccentResources.initialize(AccentResources.java:154)
at com.negusoft.holoaccent.AccentResources.checkInitialized(AccentResources.java:148)
...
unpacked-libs\cnh_library\res\values\values.xml:728: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.
Seems there's some issue with themed text selection handle.
This problem happens on Japanese phones mostly.
java.lang.ClassCastException: android.graphics.drawable.LayerDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
at android.widget.Editor$HandleView.updateDrawable(Editor.java:3148)
at android.widget.Editor$HandleView.<init>(Editor.java:3134)
at android.widget.Editor$InsertionHandleView.<init>(Editor.java:3520)
at android.widget.Editor$InsertionPointCursorController.getHandle(Editor.java:3796)
at android.widget.Editor$InsertionPointCursorController.show(Editor.java:3771)
at android.widget.Editor.onTouchUpEvent(Editor.java:1669)
at android.widget.TextView.onTouchEvent(TextView.java:7574)
at android.view.View.dispatchTouchEvent(View.java:7134)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1946)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1400)
at android.app.Activity.dispatchTouchEvent(Activity.java:2403)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1894)
at android.view.View.dispatchPointerEvent(View.java:7314)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3291)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3236)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4277)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4256)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4348)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:125)
at android.os.Looper.loop(Looper.java:124)
at android.app.ActivityThread.main(ActivityThread.java:4903)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method)
For a fragment layout that contains a ListView, the layout preview in Android Studio doesn't render anything and tells me:
Failed to find style 'listViewStyle' in current theme
(29 similar errors not shown)
Failed to convert ?textColorHighlight into a ColorStateList
(12 similar errors not shown)
I'm not sure if the problem is based in holoaccent or in Android Studio. But before using the library the preview rendered fine. If I switch back my theme to inherit from "android:Theme.Holo.Light", preview rendering is fine again.
Any idea?
Extend support to SeekBar widget.
I'm trying to use this library along with https://github.com/johnkil/Android-RobotoTextView
However, I'm getting this error:
Attribute "typeface" has already been defined
I can fix this by prefixing typeface in one of the libraries (e.g. ha__typeface) but wondered if you knew of any better solution.
Hey I'm trying to use HoloAccent and up until a few days ago the accent has been using my custom style, but now it seems to be defaulting to the Android blue.
In HolloAccentSample, tab TEXT FIELDS, guide of autocomplete is not so helpful. Its hint is "autocomplete" but I don't know what kind of autocomplete text is. I must read resource (string.xml
> list_items
) to know it's autocomplete of number (from one to thirteen).
I think you should change its hint to "autocomplete (number)", or change data of list_items
to countries.
BTW, your HoloAccent lib is so great. Just change 1 line of code and my app has new theme. Many thanks.
I've overridden getOverrideAccentColor()
and getOverrideAccentColorDark()
from AccentActivity
and it works great in most cases. However with layout defineded as:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/accentColorDark"
android:textColor="?attr/accentColor"
android:text="someText" />
Color of text and background is the same as color defined in XML. It's not overridden by AccentHelper, so I'm left with my base color.
I was looking into some internals and colors that are defined in XML as ?attr/accentColor
are not resolved by AccentHelper/AccentResources. Do you have solution for that? Or maybe there is other way to access accent color from XML?
The seek bar works fine, except that the thumb is not showing. It is e.g. possible to change it's value, but one can not see where the thumb currently is.
Nexus 6:
https://www.dropbox.com/s/7zmma4gdr7o9jus/Screenshot_2015-05-03-13-51-50.png?dl=1
Great idea! If you backport this to API level 10 (with AppCompat) I'd certainly use it in my current project.
It would be very helpful to have this library mirrored on maven central. With it being open source, Sonatype will even host it for free!
Android Studio can't preview any theme that reference to HoloAccent Theme.
Rendering Problems
Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'textViewStyle' in current theme (16 similar errors not shown)
<style name="Theme.MyTheme" parent="Theme.HoloAccent.Light.DarkActionBar">
</style>
Works fine on 4.4 and crash on Android L
Log:
06-28 16:36:41.816: E/AndroidRuntime(9650): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ha__actionbar_item_background.xml from drawable resource ID #0x7f02003a
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.content.res.Resources.loadDrawableForCookie(Resources.java:2363)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.content.res.Resources.loadDrawable(Resources.java:2265)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.content.res.TypedArray.getDrawable(TypedArray.java:743)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.view.View.(View.java:3693)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.view.ViewGroup.(ViewGroup.java:487)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.widget.LinearLayout.(LinearLayout.java:200)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.widget.LinearLayout.(LinearLayout.java:196)
06-28 16:36:41.816: E/AndroidRuntime(9650): at android.widget.Li
06-28 16:36:41.820: E/ActivityManager(767): Invalid thumbnail dimensions: 768x768
I found no way to customize the blue touch feedback in the menu when it's triggered via the hard menu key. Can this library override it?
When creating a AccentAlertDialog
without a message, the divider does not get painted.
Code causing problem:
AlertDialog dialog = new AccentAlertDialog.Builder(getActivity())
.setTitle(R.string.prompt_confirm)
.setPositiveButton(R.string.button_yes_delete, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do stuff
}
})
.setNegativeButton(R.string.prompt_no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do stuff
}
})
.show();
new DividerPainter(getActivity()).paint(dialog.getWindow());
The activity is an AccentFragmentActivity
as per the Wiki.
Adding a message solves the problem.
I get an exception when using the library.
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ha__list_selector_transition.xml from drawable resource ID #0x7f020069
You can easily reproduce the problem with this project:
https://github.com/StephaneBg/HoloAccentTest
I wish you can add a demo of AccentSearchView to HoloAccentSample.
It would be great if you could add support for ActionBarActivity and FragmentActivity as a lot of apps (including mine) still uses support library. It shouldn't be a big deal, except need of adding dependency to support library.
I believe this is a similar issue to things not rendering correctly in 5.0. Looking at the scrubber_control_selector i see it directly uses the *_reference drawables. This no longer works ion 5.1
Hi! I'm making my first steps with HoloAccent and I found a problem: if I specify any action bar related style other than accentColor(normal, dark and action bar), like for example a 9 patch background for the action bar or a color background to solve the launch activity glitch as indicated in the wiki
I want to know how to use HoloAccent with ActionBarCompat (or with ActionBarSherlock - but it's deprecated now, so we're safely to ignore it).
To use HoloAccent, all activities must extent AccentActivity
while ActionBarCompat is ActionBarActivity
.
I know we can make main activity extends ActionBarActivity
, then follow guide in https://github.com/negusoft/holoaccent/wiki/Pro-Tips-&-Tricks to theme this activity. Moreover, an ActionBarActivity activity must have theme Theme.AppCompat
.
But do you have any simpler solution to combine HoloAccent with ActionBarCompat?
"android:ListSeparatorTextView" is being used by PreferenceFragment for each PreferenceCategory.
I don't think it is an high priority issue, but running an application on a Nexus 5 with Android L-Preview doesn't generate button assets and ActionBar background colors.
Buttons appear like white boxes, ActionBar is black.
I test this app in 2 devices: Nexus 7 2013 (Android 4.4.2) and Galaxy S3 (Android 4.3.1) and see its MenuItem background is different. I choose theme Light Colored ActionBar Inverse
You will notice in Nexus 7 2013, when selected Dialog Fragment
MenuItem, its background turns to green, while in Galaxy S3 is default holo color.
Do you know why?
BTW, do you also notice although I choose Light Colored ActionBar Inverse
but it seems MenuItem in Nexus 7 is Dark while in Galaxy S3 is Light theme. Is it expected behavior?
In the sample, "Theme & color" has these values which I think it's typo:
Should it be ColoredActionBar
instead of ColoredeActionBar
(an e
character is redundant)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.