android-tooltips icon indicating copy to clipboard operation
android-tooltips copied to clipboard

E/PropertyValuesHolder: Couldn't find setter/getter

Open marios-codes opened this issue 10 years ago • 1 comments

Hello there and thank you for this really helpful library. I tried to implement it to my project and I get the following error:

E/PropertyValuesHolder﹕ Couldn't find setter/getter for property translationX with value type int E/PropertyValuesHolder﹕ Couldn't find setter/getter for property translationY with value type int

Sorry if I am doing something wrong, but I am trying this for hours. I want to show the tooltip on an ImageView without having to click it.

My implementation code for MyActivity is as follows:

public class MyActivity extends Activity {

private static final int POINTER_SIZE = 15;
private ToolTipLayout tipContainer;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.myActivity);

    // Get the tooltip layout
    tipContainer = (ToolTipLayout) findViewById(R.id.tooltip_container);

..... blah blah blah .....

 // Create a ToolTip using the Builder class
    View contentView = createToolTipView("Tooltip right of the button",
            Color.WHITE, getResources().getColor(Color.RED));
    contentView.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT
    ));

    ToolTip t = new ToolTip.Builder(MyActivity.this)
            .anchor(findViewById(R.id.bigPhoto))
            .color(getResources().getColor(Color.RED))
            .gravity(Gravity.BOTTOM)
            .pointerSize(POINTER_SIZE)
            .contentView(contentView)
            .build();

  // Add the ToolTip to the view, using the default animations
        tipContainer.addTooltip(t);
}

   public View createToolTipView(String text, int textColor, int bgColor) {
    float density = getResources().getDisplayMetrics().density;
    int padding = (int) (8 * density);

    TextView contentView = new TextView(MyActivity.this);
    contentView.setPadding(padding, padding, padding, padding);
    contentView.setText(text);
    contentView.setTextColor(textColor);
    contentView.setBackgroundColor(bgColor);
    return contentView;
}

 }

marios-codes avatar Nov 26 '14 16:11 marios-codes

same issue to me. as well

noman-iqbal avatar Mar 31 '15 13:03 noman-iqbal