Android versions lower than API Level 21 using appcompat

In the following code, android:progressTint="#c9c9c9", android:secondaryProgressTint="#bebebe" and android:thumbTint="#a9a9a9" are API Level 21 features. However, I am currently using com.android.support:appcompat-v7:23.1.1. Will my app run on devices lower than API 21?

            <SeekBar
                android:id="@+id/teacher_intro_seekbar"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:progress="10"
                android:paddingRight="10dp"
                android:progressTint="#c9c9c9"
                android:secondaryProgressTint="#bebebe"
                android:thumbTint="#a9a9a9" />

Answers


Yes they will work for API 21 and above, For lower versions they will be ignored. If you want for all versions use app compat seekbar as below.

   <android.support.v7.widget.AppCompatSeekBar
    android:id="@+id/teacher_intro_seekbar"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:progress="10"
    android:paddingRight="10dp"
    app:progressTint="#c9c9c9"
    app:secondaryProgressTint="#bebebe"
    app:thumbTint="#a9a9a9" />

It will run, but it may not look correct. XML properties not recognized are ignored. In this case they will definitely be ignored- you aren't using an app compat version of Seekbar, so the compatibility library doesn't matter. (I don't know if there is an app compat version of seekbar, but even if there is you aren't using it).


Need Your Help

Writing to a closed, local TCP socket not failing

c linux sockets tcp glibc

I seem to be having a problem with my sockets. Below, you will see some code which forks a server and a client. The server opens a TCP socket, and the client connects to it and then closes it. S...

Get all instances of a class in objective c?

objective-c ios class-method

I have a UIView that has many instances and each one of them has a UIRecognizer.