This is my base theme for application:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorSecondaryLight</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:buttonStyle">@style/NormalButtonStyle</item>
<item name="buttonStyle">@style/NormalButtonStyle</item>
</style>
And this is NormalButtonStyle:
<style name="NormalButtonStyle" parent="@style/Widget.AppCompat.Button">
<item name="android:textColor">@android:color/white</item>
<item name="fontPath">fonts/TitilliumWeb-SemiBold</item>
<item name="android:backgroundTint">@color/colorAccent</item>
<item name="android:colorButtonNormal">@color/progressBar</item>
<item name="android:textAllCaps">true</item>
<item name="android:colorControlHighlight">@color/colorSecondaryLight</item>
<item name="colorControlHighlight">@color/colorSecondaryLight</item>
</style>
Here fontPath is attribute of Calligraphy library. But it is not working for me.
This is one of the AppCompatButton Code:
<android.support.v7.widget.AppCompatButton
android:id="@+id/btnLoginSignIn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/txt_sign_in"
android:layout_below="@id/tilLoginPassword"
android:layout_marginTop="@dimen/dimen_top_margin_normal"
android:layout_alignStart="@id/tilLoginPassword"
android:layout_alignEnd="@id/tilLoginPassword"/>
What am I doing wrong?
Android Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.astound.farmroster">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:name=".app.MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".activity.Splash"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBarFullScreen"
android:windowSoftInputMode="adjustResize|stateHidden">
</activity>
<activity
android:name=".activity.Login"
android:label="@string/txt_sign_in"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".activity.Dashboard"
android:label="@string/title_activity_dashboard"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize|stateHidden">
</activity>
<activity
android:name=".activity.JobList"
android:label="@string/title_activity_job_list"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize|stateHidden">
</activity>
<activity
android:name=".activity.JobDetail"
android:label="@string/title_activity_job_detail"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize|stateHidden">
</activity>
</application>
</manifest>
Use the Full file path with Extension:
instead of:
use:
Regarding your Second Question: Both are Right.
Usage example
theme.xml:
v21/theme.xml
For More Help See this Answer
add full file name to "fontPath" attribute in your style like: