.class.class
R.javaはソースコードとリソースを結びつける MainActivity.java! findviewbyid(r.id.button) layout.xml R.java <Button android:id= @+id/button >
予めR.javaの内容を知る リソースを元にR.javaを 事ができない 作成する findviewbyid(r.id.button)
.class.class
.class.class
https://github.com/bearded-hen/android-bootstrap
http://getbootstrap.com/
http://getbootstrap.com/css/#buttons
<?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="customview"> <attr name="color" format="string"/> <attr name="transparent" format="boolean"/> </declare-styleable> </resources>
public CustomView(Context context, AttributeSet attrs) { super(context, attrs);! TypedArray typedarray = context.obtainstyledattributes(attrs, R.styleable.CustomView); String type = typedarray.getstring(r.styleable.customview_color); boolean transparent = typedarray.getboolean(r.styleable.customview_transparent, false); } //...
public CustomView(Context context, AttributeSet attrs) { super(context, attrs);! TypedArray typedarray = context.obtainstyledattributes(attrs, R.styleable.CustomView); String type = typedarray.getstring(r.styleable.customview_color); boolean transparent = typedarray.getboolean(r.styleable.customview_transparent, false); } //...
public CustomView(Context context, AttributeSet attrs) { super(context, attrs);! TypedArray typedarray = context.obtainstyledattributes(attrs, R.styleable.CustomView); String type = typedarray.getstring(r.styleable.customview_color); boolean transparent = typedarray.getboolean(r.styleable.customview_transparent, false); } //...
<declare-styleable name="bootstrapbutton"> <attr name="bb_type" format="string"/> <attr name="bb_icon_left" format="string"/> <attr name="bb_icon_right" format="string"/> <attr name="bb_roundedcorners" format="boolean"/> <attr name="bb_text_alignment" format="string"/> <attr name="bb_size" format="string"/> <attr name="bb_text_gravity" format="string"/> <attr name="android:textsize"/> <attr name="android:text"/> <attr name="android:enabled"/> <attr name="android:layout_width"/> </declare-styleable> https://github.com/bearded-hen/android-bootstrap/wiki/bootstrap-button
<com.beardedhen.androidbootstrap.bootstrapbutton android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" android:text="hello Bootstrap!" library:bb_icon_right="fa-android" library:bb_type="success" /> <com.beardedhen.androidbootstrap.bootstrapbutton android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" android:text="hello Bootstrap!" library:bb_icon_right="fa-bell" library:bb_type="danger" />
BootstrapButton のカスタム属性 http://fortawesome.github.io/font-awesome/cheatsheet/ FontAwesomeTextやbb_icon_leftなどに指定できるアイコン
BootstrapCircleThumbnail FontAwesomeText BootstrapButton
https://github.com/techbooster/androidopentextbook/blob/master/code/library/profileapp/res/layout/activity_main.xml