Commit 8e5c1a24 authored by rakam's avatar rakam

Add RobotoViews

parent 28f239c2
......@@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:name=".AceCreamApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
......
package fr.istic.masteru.android;
import android.app.Application;
import fr.istic.masteru.android.utils.FontUtils;
public class AceCreamApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FontUtils.loadFont(getApplicationContext());
}
}
package fr.istic.masteru.android.utils;
import android.content.Context;
import android.graphics.Typeface;
public class FontUtils {
public static Typeface robotoThinFont;
public static void loadFont(Context context) {
robotoThinFont = Typeface.createFromAsset(context.getAssets(), "Roboto-Thin.ttf");
}
}
package fr.istic.masteru.android.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;
import fr.istic.masteru.android.utils.FontUtils;
public class RobotoButton extends Button {
public RobotoButton(Context context) {
super(context);
setTypeface(FontUtils.robotoThinFont);
}
public RobotoButton(Context context, AttributeSet attrs) {
super(context, attrs);
setTypeface(FontUtils.robotoThinFont);
}
public RobotoButton(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setTypeface(FontUtils.robotoThinFont);
}
}
package fr.istic.masteru.android.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import fr.istic.masteru.android.utils.FontUtils;
public class RobotoTextView extends TextView {
public RobotoTextView(Context context) {
super(context);
setTypeface(FontUtils.robotoThinFont);
}
public RobotoTextView(Context context, AttributeSet attrs) {
super(context, attrs);
setTypeface(FontUtils.robotoThinFont);
}
public RobotoTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setTypeface(FontUtils.robotoThinFont);
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#9e9e9e" android:state_enabled="false"/>
<item android:color="#bbb" android:state_enabled="false"/>
<item android:color="#eee" android:state_selected="true"/>
<item android:color="#6c6c6c" android:state_checked="true"/>
<item android:color="#6c6c6c" android:state_pressed="true"/>
<item android:color="#6c6c6c"/>
<item android:color="#555" android:state_checked="true"/>
<item android:color="#555" android:state_pressed="true"/>
<item android:color="#555"/>
</selector>
\ No newline at end of file
......@@ -16,40 +16,47 @@
android:src="@drawable/acecream_512"
android:layout_centerHorizontal="true"/>
<LinearLayout
android:orientation="vertical"
<ScrollView
android:layout_width="600dp"
android:layout_height="match_parent"
android:layout_below="@id/_title"
android:layout_centerHorizontal="true"
android:paddingBottom="10dp"
android:paddingTop="20dp">
android:scrollbars="none">
<Button
android:id="@+id/startMatchButton"
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="30dp"
android:layout_marginBottom="20dp"
android:text="@string/start_match"
android:textColor="@color/ac_button_color"
android:textSize="22sp"
android:background="@drawable/ac_button_background"/>
<Button
android:id="@+id/resumeMatchButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="30dp"
android:layout_marginBottom="20dp"
android:background="@drawable/ac_button_background"
android:text="@string/resume_match"
android:textColor="@color/ac_button_color"
android:enabled="false"
android:textSize="22sp"/>
</LinearLayout>
android:layout_gravity="center_vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<fr.istic.masteru.android.views.RobotoButton
android:id="@+id/startMatchButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="30dp"
android:paddingTop="400dp"
android:layout_marginBottom="20dp"
android:text="@string/start_match"
android:textColor="@color/ac_button_color"
android:textSize="22sp"
android:background="@drawable/ac_button_background"/>
<fr.istic.masteru.android.views.RobotoButton
android:id="@+id/resumeMatchButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="30dp"
android:layout_marginBottom="20dp"
android:background="@drawable/ac_button_background"
android:text="@string/resume_match"
android:textColor="@color/ac_button_color"
android:enabled="false"
android:textSize="22sp"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment