EditTexts in the tag editors are dynamically themed, also fixed toolbar gravity in tag editors
This commit is contained in:
parent
e07614d065
commit
22c701a5f0
3 changed files with 49 additions and 13 deletions
|
|
@ -0,0 +1,34 @@
|
|||
package com.kabouzeid.gramophone.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v7.internal.widget.TintCheckBox;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.afollestad.materialdialogs.ThemeSingleton;
|
||||
import com.afollestad.materialdialogs.internal.MDTintHelper;
|
||||
|
||||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
public class DynamicEditText extends TintCheckBox {
|
||||
|
||||
public DynamicEditText(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public DynamicEditText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public DynamicEditText(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
final int color = ThemeSingleton.get().positiveColor;
|
||||
MDTintHelper.setTint(this, color);
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
android:paddingRight="16dp"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/album_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
android:text="@string/album_artist"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/album_artist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -80,6 +80,7 @@
|
|||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?attr/title_text_color" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -95,7 +96,7 @@
|
|||
android:text="@string/genre"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/genre"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -106,6 +107,7 @@
|
|||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?attr/title_text_color" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -121,7 +123,7 @@
|
|||
android:text="@string/year"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/year"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -133,6 +135,7 @@
|
|||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="?attr/title_text_color" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -140,13 +143,12 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:gravity="start|left|top"
|
||||
android:gravity="start|left"
|
||||
android:background="#00000000"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
android:paddingRight="16dp"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/title1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/title2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
android:text="@string/artist"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/artist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
android:text="@string/genre"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/genre"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
android:text="@string/year"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/year"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
android:text="@string/track"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||
|
||||
<EditText
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
android:id="@+id/track_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_gravity="start|left|top"
|
||||
android:layout_gravity="start|left"
|
||||
android:background="#00000000"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue