rharter / android-tooltips Goto Github PK
View Code? Open in Web Editor NEWCustom tooltips for android.
Custom tooltips for android.
allowBackup="true" causes merger error in projects which has this attribute set to false. tools:replace"allowBackup" doesn't seem to work and is an open issue with google as mentioned here.
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;
}
}
As titled, I think this issue exists on Android Studio beta too.
As titled
Is there any way to align a tooltip with Gravity.TOP set with a WRAP_CONTENT width just above target view?
Code involved:
View contentView = createToolTipView("Tooltip above the button",
Color.BLACK, getResources().getColor(android.R.color.holo_green_light));
contentView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
));
ToolTip t = new Builder(callingActivity)
.anchor(targetView)
.color(getResources().getColor(android.R.color.holo_green_light))
.gravity(Gravity.TOP)
.pointerSize(15)
.contentView(contentView)
.build();
tipContainer.addTooltip(t);
Could you please add Gradle wrapper to simplify project build?
How can you set a tooltip for an actionbar item?
How can i set tool tip inside listview for a particular item. On scroll the tool tip also scroll with item or dissmiss and when again that item position cam tool tip again show at same position
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.