Fix tiny theme and other

This commit is contained in:
h4h13 2019-10-03 22:43:04 +05:30
parent 8116bbbba8
commit e5cab894ca
16 changed files with 42 additions and 20 deletions

4
.gitignore vendored
View file

@ -38,3 +38,7 @@ obj/
captures captures
app/normal/release/ app/normal/release/
/models/ /models/
app/font/
app/src/debug/
app/src/font/

View file

@ -4,12 +4,12 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
android { android {
compileSdkVersion 29 compileSdkVersion 28
defaultConfig { defaultConfig {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 28
renderscriptTargetApi 29 //must match target sdk and build tools renderscriptTargetApi 28 //must match target sdk and build tools
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"

View file

@ -20,15 +20,13 @@ import android.text.TextPaint;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.Gravity; import android.view.Gravity;
import androidx.annotation.NonNull; import androidx.appcompat.widget.AppCompatTextView;
import androidx.annotation.Nullable;
import com.google.android.material.textview.MaterialTextView;
public class VerticalTextView extends MaterialTextView { public class VerticalTextView extends AppCompatTextView {
final boolean topDown; final boolean topDown;
public VerticalTextView(@NonNull Context context, @Nullable AttributeSet attrs) { public VerticalTextView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
final int gravity = getGravity(); final int gravity = getGravity();
if (Gravity.isVertical(gravity) && (gravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.BOTTOM) { if (Gravity.isVertical(gravity) && (gravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.BOTTOM) {
@ -36,16 +34,17 @@ public class VerticalTextView extends MaterialTextView {
topDown = false; topDown = false;
} else } else
topDown = true; topDown = true;
} }
@Override @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec); super.onMeasure(heightMeasureSpec, widthMeasureSpec);
setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth()); setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
} }
@Override @Override
protected void onDraw(@NonNull Canvas canvas) { protected void onDraw(Canvas canvas) {
TextPaint textPaint = getPaint(); TextPaint textPaint = getPaint();
textPaint.setColor(getCurrentTextColor()); textPaint.setColor(getCurrentTextColor());
textPaint.drawableState = getDrawableState(); textPaint.drawableState = getDrawableState();

View file

@ -26,6 +26,7 @@
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewHeadline3" android:textAppearance="@style/TextViewHeadline3"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"

View file

@ -89,6 +89,7 @@
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:textStyle="bold"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
app:layout_constraintBottom_toTopOf="@+id/text" app:layout_constraintBottom_toTopOf="@+id/text"

View file

@ -96,6 +96,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -74,6 +74,7 @@
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/text" app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"

View file

@ -73,6 +73,7 @@
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -33,8 +33,9 @@
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewHeadline6"
android:textColor="@color/md_white_1000" android:textColor="@color/md_white_1000"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/songFavourite" app:layout_constraintEnd_toStartOf="@+id/songFavourite"
app:layout_constraintStart_toEndOf="@+id/playerMenu" app:layout_constraintStart_toEndOf="@+id/playerMenu"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"

View file

@ -77,8 +77,9 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6" android:textAppearance="@style/TextViewHeadline6"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/text" app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"

View file

@ -78,6 +78,7 @@
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/text" app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"

View file

@ -80,6 +80,7 @@
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/text" app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"

View file

@ -24,6 +24,7 @@
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/text" app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="16dp" tools:layout_editor_absoluteX="16dp"

View file

@ -46,35 +46,40 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:elevation="10dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="start"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="16dp"> android:padding="16dp">
<code.name.monkey.retromusic.views.VerticalTextView <code.name.monkey.retromusic.views.VerticalTextView
android:id="@+id/songTitle" android:id="@+id/songTitle"
style="@style/TextAppearance.MaterialComponents.Headline2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ellipsize="end" android:ellipsize="end"
android:freezesText="true" android:freezesText="true"
android:gravity="start"
android:rotation="0"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewHeadline3"
android:textStyle="bold" android:textStyle="bold"
app:textAllCaps="true"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Song title" /> tools:text="Song title" />
<code.name.monkey.retromusic.views.VerticalTextView <code.name.monkey.retromusic.views.VerticalTextView
android:id="@+id/songText" android:id="@+id/songText"
style="@style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ellipsize="end" android:ellipsize="end"
android:gravity="start"
android:maxLines="2" android:maxLines="2"
tools:text=" Album name \nby Artist name" /> android:rotation="0"
android:textAppearance="@style/TextViewHeadline6"
tools:text=" Album name \nby - Artist name" />
</LinearLayout> </LinearLayout>
@ -117,7 +122,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_gravity="end"
android:padding="16dp" android:padding="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Display3" android:textAppearance="@style/TextViewHeadline3"
android:textStyle="bold" android:textStyle="bold"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />

View file

@ -183,6 +183,10 @@
<item name="android:fontFamily">@font/circular</item> <item name="android:fontFamily">@font/circular</item>
</style> </style>
<style name="TextViewHeadline2" parent="TextAppearance.MaterialComponents.Headline2">
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="TextViewHeadline3" parent="TextAppearance.MaterialComponents.Headline3"> <style name="TextViewHeadline3" parent="TextAppearance.MaterialComponents.Headline3">
<item name="android:fontFamily">@font/circular</item> <item name="android:fontFamily">@font/circular</item>
</style> </style>