Made some progress with the new playing screen. Still WIP, very unstable and many things not working. Better don't mess with the current code.
This commit is contained in:
parent
418713df8a
commit
83fb5982ea
24 changed files with 392 additions and 630 deletions
|
|
@ -0,0 +1,43 @@
|
|||
package com.kabouzeid.gramophone.views;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SquareLayout extends FrameLayout {
|
||||
|
||||
private boolean forceSquare = true;
|
||||
|
||||
public SquareLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SquareLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public SquareLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public SquareLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
//noinspection SuspiciousNameCombination
|
||||
super.onMeasure(widthMeasureSpec, forceSquare ? widthMeasureSpec : heightMeasureSpec);
|
||||
}
|
||||
|
||||
public void forceSquare(boolean forceSquare) {
|
||||
this.forceSquare = forceSquare;
|
||||
requestLayout();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue