Redesign of MusicControllerActivity, AlbumDetailActivity and ArtistDetailActivity. A lot of bugs and other small things fixed as well.
This commit is contained in:
parent
1b702eae07
commit
9fe36b0a35
51 changed files with 1019 additions and 688 deletions
|
|
@ -0,0 +1,30 @@
|
|||
package com.kabouzeid.gramophone.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class HeightAndWidthFitSquarePlaceLeftRightImageView extends ImageView {
|
||||
|
||||
public HeightAndWidthFitSquarePlaceLeftRightImageView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public HeightAndWidthFitSquarePlaceLeftRightImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public HeightAndWidthFitSquarePlaceLeftRightImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
final int small = Math.min(widthMeasureSpec, heightMeasureSpec);
|
||||
super.onMeasure(small, small);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,25 +7,24 @@ import android.widget.ImageView;
|
|||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SquareFitImageView extends ImageView {
|
||||
public class HeightFitSquareImageView extends ImageView {
|
||||
|
||||
public SquareFitImageView(Context context) {
|
||||
public HeightFitSquareImageView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SquareFitImageView(Context context, AttributeSet attrs) {
|
||||
public HeightFitSquareImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public SquareFitImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
public HeightFitSquareImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
final int newWidth = Math.min(widthMeasureSpec, heightMeasureSpec);
|
||||
//noinspection SuspiciousNameCombination
|
||||
super.onMeasure(newWidth, newWidth);
|
||||
super.onMeasure(heightMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.kabouzeid.gramophone.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SquareIfPlaceLeftRightImageView extends ImageView {
|
||||
|
||||
public SquareIfPlaceLeftRightImageView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SquareIfPlaceLeftRightImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public SquareIfPlaceLeftRightImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
final int small = Math.min(widthMeasureSpec, heightMeasureSpec);
|
||||
final int large = Math.max(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
if (View.MeasureSpec.getSize(large) > View.MeasureSpec.getSize(small) * 1.5)
|
||||
super.onMeasure(small, small);
|
||||
else super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,17 +7,17 @@ import android.widget.ImageView;
|
|||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SquareImageView extends ImageView {
|
||||
public class WidthFitSquareImageView extends ImageView {
|
||||
|
||||
public SquareImageView(Context context) {
|
||||
public WidthFitSquareImageView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SquareImageView(Context context, AttributeSet attrs) {
|
||||
public WidthFitSquareImageView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public SquareImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
public WidthFitSquareImageView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue