logo
down
shadow

colorAccent in Holo Theme


colorAccent in Holo Theme

By : bmwvins
Date : November 29 2020, 09:01 AM
This might help you You have to use the AppCompat theme like this will behave as holo and you can set all material properties here in your value's direcotry style.xml. I have used this theme.
code :
//My Customized Theme
<style name="AppTheme"  parent="Theme.AppCompat.NoActionBar">
    <item name="colorPrimary">@color/myPrimaryColor</item>
    <item name="colorPrimaryDark">@color/myPrimaryDarkColor</item>
    <item name="colorAccent">@color/myAccentColor</item>
    <item name="android:textColorPrimary">@color/myPrimaryTextColor</item>
    <item name="android:textColorSecondary">@color/mySecondaryTextColor</item>
    <item name="android:actionBarDivider">@color/myDividerColor</item>
    <item name="android:windowActionModeOverlay">true</item>

</style>


Share : facebook icon twitter icon
How to use the Holo.Light theme but have the ActionBar use Holo withouth ICS?

How to use the Holo.Light theme but have the ActionBar use Holo withouth ICS?


By : Irshad Pc
Date : March 29 2020, 07:55 AM
Hope that helps Create a custom style and set the Parent style to the holo light theme but the ActionBar to normal Holo.
a xml file with something like this should do the job (just out of my memory):
code :
<style name="appstyle0" parent="android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@android:style/Widget.Holo.ActionBar</item>
</style>
<style name="Widget.Holo.Light.ActionBar" parent="Widget.Holo.ActionBar">
    <item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Title</item>
    <item name="android:subtitleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle</item>
    <item name="android:background">@android:drawable/ab_transparent_light_holo</item>
    <item name="android:backgroundStacked">@android:drawable/ab_stacked_transparent_light_holo</item>
    <item name="android:backgroundSplit">@android:drawable/ab_bottom_transparent_light_holo</item>
    <item name="android:homeAsUpIndicator">@android:drawable/ic_ab_back_holo_light</item>
    <item name="android:progressBarStyle">@android:style/Widget.Holo.Light.ProgressBar.Horizontal</item>
    <item name="android:indeterminateProgressStyle">@android:style/Widget.Holo.Light.ProgressBar</item>
</style>
<style name="TextAppearance.Holo.Widget.ActionBar.Title.Own"
       parent="TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">@android:color/primary_text_holo_dark</item>
    <item name="android:textColorHighlight">@android:color/highlighted_text_holo_dark</item>
    <item name="android:textColorHint">@android:color/hint_foreground_holo_dark</item>
    <item name="android:textColorLink">@android:color/holo_blue_light</item>
</style>
<item name="android:titleTextStyle">@android:style/TextAppearance.Holo.Widget.ActionBar.Title.Own</item>
How to align title at center of ActionBar in default theme(Theme.Holo.Light)

How to align title at center of ActionBar in default theme(Theme.Holo.Light)


By : Shibin Chrisby
Date : March 29 2020, 07:55 AM
this one helps. You can create a custom layout and apply it to the actionBar.
To do so, follow those 2 simple steps:
code :
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.actionbar);
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:orientation="vertical">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:id="@+id/action_bar_title"
    android:text="YOUR ACTIVITY TITLE"
    android:textColor="#ffffff"
    android:textSize="24sp" />
</LinearLayout>
TextView title=(TextView)findViewById(getResources().getIdentifier("action_bar_title", "id", getPackageName()));
title.setText("Your Text Here");
_HoloActivity$HoloThemeException: You must apply Holo.Theme, Holo.Theme.Light or Holo.Theme.Light.DarkActionBar theme

_HoloActivity$HoloThemeException: You must apply Holo.Theme, Holo.Theme.Light or Holo.Theme.Light.DarkActionBar theme


By : Abdullah
Date : March 29 2020, 07:55 AM
it fixes the issue AFAICT there is absolutely nothing wrong with either my code or with HoloEverywhere.
For some inexplicable reason those devices sometimes seem to lose the Holo.Theme attribute from the Activity's style. This causes HE to throw an Exception.
code :
@Override
protected Holo onCreateConfig(Bundle savedInstanceState) {
    final Holo config = super.onCreateConfig(savedInstanceState);
    config.ignoreThemeCheck = true;
    return config;
}
How to launch project with Material Theme on older versions with Holo theme?

How to launch project with Material Theme on older versions with Holo theme?


By : Readone
Date : March 29 2020, 07:55 AM
may help you . Try adding in your AndroidManifest.xml file.
Instead of referencing L or android-L in your build.gradle, just use 21:
code :
android {
    compileSdkVersion 21
    buildToolsVersion '20.0.0'
    defaultConfig {
        applicationId 'com.temdev.yesno'
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName '1.15.8'
    }
    ...
}
Image in Action bar without AppCompatActivity and with android:Theme.Holo.Light theme

Image in Action bar without AppCompatActivity and with android:Theme.Holo.Light theme


By : Joey Greer
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I want to place an image(ImageView) in top right corner of an Action bar. I don't want to use AppCompatActivity library and so my MainActivity extends Activity instead of AppCompatActivity. I use theme: