Fix tiny theme and other

main
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
app/normal/release/
/models/
app/font/
app/src/debug/
app/src/font/

View File

@ -4,12 +4,12 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
compileSdkVersion 28
defaultConfig {
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
applicationId "code.name.monkey.retromusic"

View File

@ -126,7 +126,7 @@ class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Ca
private fun updateSong() {
val song = MusicPlayerRemote.currentSong
songTitle.text = song.title
songText.text = String.format("%s \nby -%s", song.albumName, song.artistName)
songText.text = String.format("%s \nby - %s", song.albumName, song.artistName)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@
<item name="android:textSize">16sp</item>
</style>
<style name="ToolbarTextAppearanceNormal" >
<style name="ToolbarTextAppearanceNormal">
<item name="android:textSize">20sp</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6
</item>
@ -183,6 +183,10 @@
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="TextViewHeadline2" parent="TextAppearance.MaterialComponents.Headline2">
<item name="android:fontFamily">@font/circular</item>
</style>
<style name="TextViewHeadline3" parent="TextAppearance.MaterialComponents.Headline3">
<item name="android:fontFamily">@font/circular</item>
</style>