Android Open Source - AndroidTouchEditableListView Touch Editable Divider Drawable






From Project

Back to project page AndroidTouchEditableListView.

License

The source code is released under:

Copyright (c) 2014 Serge Desmedt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Soft...

If you think the Android project AndroidTouchEditableListView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package be.trojkasoftware.android.obsolete;
//from   www  .  ja va  2  s  .co m
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.MeasureSpec;
import android.widget.AbsListView;

public class TouchEditableDividerDrawable extends Drawable {

    private static final String TAG = "TouchEditableDividerDrawable";

  public TouchEditableDividerDrawable(Drawable originalDivider, TouchEditableListView2 parent)
  {
    this.originalDivider = originalDivider;
        mParent = parent;
  }

  public Drawable getOriginalDivider()
  {
    return originalDivider;
  }
  
  @Override
  public void draw(Canvas canvas) {
    Log.i(TAG, "draw:"+Math.abs(mParent.getOffsetY()));
      
      Matrix matrix;
      matrix = new Matrix();
    matrix.postTranslate(0, -1 * Math.abs(mParent.getOffsetY()));
    
      final Matrix currentMatrix = canvas.getMatrix();     
      canvas.concat(matrix);
      
      originalDivider.draw(canvas);
        
        canvas.setMatrix(currentMatrix);
  }

  @Override
  public int getOpacity() {
    return originalDivider.getOpacity();
  }

  @Override
  public void setAlpha(int arg0) {
    originalDivider.setAlpha(arg0);
  }

  @Override
  public void setColorFilter(ColorFilter arg0) {
    originalDivider.setColorFilter(arg0);
  }
    
    TouchEditableListView2 mParent;
  Drawable originalDivider;

}




Java Source Code List

be.trojkasoftware.android.obsolete.TouchEditableDividerDrawable.java
be.trojkasoftware.android.obsolete.TouchEditableInsertManager.java
be.trojkasoftware.android.obsolete.TouchEditableListView10.java
be.trojkasoftware.android.obsolete.TouchEditableListView20.java
be.trojkasoftware.android.obsolete.TouchEditableListView2.java
be.trojkasoftware.android.sample.AndroidTouchEditableListViewSampleActivity.java
be.trojkasoftware.android.sample.CustomEditableArrayAdapter.java
be.trojkasoftware.android.touch.TouchDataStore.java
be.trojkasoftware.android.touch.TouchData.java
be.trojkasoftware.android.toucheditablelistview.EditableArrayAdapter.java
be.trojkasoftware.android.toucheditablelistview.TouchEditableActionView.java
be.trojkasoftware.android.toucheditablelistview.TouchEditableItemView.java
be.trojkasoftware.android.toucheditablelistview.TouchEditableListView.java
be.trojkasoftware.android.toucheditablelistview.TouchEditableStateManager.java