Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No style applied #30

Closed
benoffi7 opened this issue Aug 22, 2014 · 10 comments
Closed

No style applied #30

benoffi7 opened this issue Aug 22, 2014 · 10 comments

Comments

@benoffi7
Copy link

Hello there! I'm using the library and it works perfect. The only problem I have is that you can not apply styles

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:id="@+id/viewFlipper"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:addStatesFromChildren="true"
    android:background="@color/azul_us"
    android:orientation="vertical" >

 <com.daimajia.slider.library.SliderLayout
        android:id="@+id/slider"
        android:layout_width="match_parent"
        android:layout_height="200dp" />

    <com.daimajia.slider.library.Indicators.PagerIndicator
        android:id="@+id/custom_indicator"
        style="@style/AndroidImageSlider_Magnifier_Oval_Black" />
</LinearLayout>


  <style name="AndroidImageSlider_Magnifier_Oval_Black">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:gravity">right</item>
        <item name="android:paddingLeft">2dp</item>
        <item name="android:paddingRight">2dp</item>
        <item name="shape">rect</item>
        <item name="padding_left">3dp</item>
        <item name="padding_right">3dp</item>
        <item name="padding_top">4dp</item>
        <item name="padding_bottom">4dp</item>

        <item name="selected_color">#7ac943</item>
        <item name="unselected_color">#33000000</item>
        <item name="selected_width">8dp</item>
        <item name="selected_height">8dp</item>
        <item name="unselected_width">6dp</item>
        <item name="unselected_height">6dp</item>
    </style>

Thanks!!

screenshot_2014-08-22-07-27-29

@daimajia
Copy link
Owner

Thanks for your feedback, I'll test it later~

@daimajia
Copy link
Owner

BTW.
Do the attributes work when you just put them in the tag instead of using style attribute ?

@daimajia
Copy link
Owner

Hey, dude.

I tested the issue you mentioned, It works well... You can download the demo apk, and test if it works on you devices.

https://github.com/daimajia/AndroidImageSlider/releases/download/v1.0.8/demo-1.0.8.apk

@benoffi7
Copy link
Author

@daimajia the attributes does not work if I put in the XML element :(

<com.daimajia.slider.library.Indicators.PagerIndicator
android:id="@+id/custom_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
custom:selected_color="@color/verde_us"
custom:unselected_color="#55555555"
custom:shape="rect"
custom:selected_padding_left="3dp"
custom:selected_padding_right="3dp"
custom:unselected_padding_left="3dp"
custom:unselected_padding_right="3dp"
custom:selected_width="8dp"
custom:selected_height="8dp"
custom:unselected_width="4dp"
custom:unselected_height="4dp"
/>

In my phone the apk looks greats with the custom indicator (the bird)

I'm using eclipse...

@daimajia
Copy link
Owner

It's a little bit weird...

Have you ever tried the project I organized for eclipse users. If not, please have a try, and give me a feedback, I'll check if there is any error in project code etc.

#28
https://github.com/daimajia/AndroidImageSlider#eclipse

@benoffi7
Copy link
Author

The problem was here

    slider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));

I dont have this line. Now is fix. Please add it in your tutorial

Thanks for the help!

@daimajia
Copy link
Owner

You must miss something, cause I have already added this in wiki tutorial... :-D

https://github.com/daimajia/AndroidImageSlider/wiki/Custom-Indicators#using-the-view

@benoffi7
Copy link
Author

Ahhhhhh, sorry for that. Thanks for the help again

@Bohemiaking
Copy link

Me Too forget to see
hahahahahaha

@annng
Copy link

annng commented Aug 30, 2018

i had slPhoto.setCustomIndicator(piIndicator) but doesnt work.. i use kotlin
should do i add the code after addSlider or before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants