Saturday 15 January 2011

android - Scala's class to Java -


Please help me with this Scala class, I want it implemented on Java have:

code> class StretchVideoView (Reference: Context, attr: AttributeSet) Hui VideoView (reference, attrib) measuring {def (measureSpec: Int): Int = {val specMode = View.MeasureSpec.getMode (measureSpec) View.MeasureSpec.getSize (measureSpec)} override def onMeasure (widthMeasureSpec: Int, heightMeasureSpec : Int) {val (w, h) = (item (WidthMeasureSpec), item (HeightMeasureSpec)) GetHolder () SetFixedSize (w, h) super.onMeasure (widthMeasureSpec, heightMeasureSpec.)}}

I also do it myself Try here is my Java code to:

  class StretchVideoView extends VideoView {public StretchVideoView (reference context, AttributeSet attrs) {super (context, attrs); } Public int measurement (int measureSpec) {int specMode = View.MeasureSpec.getMode (measureSpec) ??? View.MeasureSpec.getSize (measureSpec); // maybe + here ??? Return sample; // ??? } // And I'm not sure about this: Override measurement on public zero (integer width measurement aspect, integer height measurement SPS) {int w = measurement (measurement SPS); Int H = Measurement (heightmeasureSpec); . GetHolder () setFixedSize (h, w); Super.onMeasure (width measurement aspect, height measurement aspect); }}   

Any suggestions on how to implement it on Java?

Here is the original article with this code:

I think you measurement :

  public int size (int MeasureSpec) {int specMode = View.MeasureSpec.getMode (measureSpec) see returns. MouseSpeczet Size (measurement SPS); }    

No comments:

Post a Comment