GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nilopc-learning-android/CustomView__material-tip: Android Library for prompt tip

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
library
library
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
preview.gif
preview.gif
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

material-tip

Android Library for prompt tip ( according to offer education )

Build Status Android Arsenal git-card

Sample

How to include

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
      ...
      maven { url "https://jitpack.io" }
    }
  }

Step 2. Add the dependency

dependencies {
    compile 'com.github.fcannizzaro:material-tip:1.0.5'
}

Custom View + TipBehavior

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    	<android.support.design.widget.FloatingActionButton
       		...
        	app:layout_behavior="com.github.fcannizzaro.materialtip.TipBehavior"/>

    	...

    	<com.github.fcannizzaro.materialtip.MaterialTip
			android:id="@+id/tip"
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="bottom"
			...
			app:tip_background="color"
			app:tip_color="color"
			app:tip_text_color="color"
			app:tip_title_color="color"
			app:tip_icon="drawable"
			app:tip_negative="string"
			app:tip_positive="string"
			app:tip_text="string"
			app:tip_title="string"/>

</android.support.design.widget.CoordinatorLayout>

Builder Methods

withButtonListener(ButtonListener)

Attach the button listener

new ButtonListener() {

	@Override
	public void onPositive(MaterialTip tip) {
		System.out.println("positive");
    }

    @Override
    public void onNegative(MaterialTip tip) {
		System.out.println("negative");
	}

}

withTitle(String)

Set tip title

withText(String)

Set tip text

withPositive(String)

Set tip positive button text

withNegative(String)

Set tip negative button text

withIcon(Drawable)

Set tip icon

withColor(int)

Set tip primary color

withBackground(int)

Set tip background color

withTitleColor(int)

Set tip title color

withTextColor(int)

Set tip text color

Note

Each builder method is also available with Resources arg (ex. withTextRes, withTitleRes).

Void Methods

show()

animate and show the tip

hide()

animate and hide the tip

toggle()

animate and show/hide the tip

Sample

MaterialTip tip = (MaterialTip) findViewById(R.id.tip);

tip
	.withTitle("Ok Google")
	.withText("Something!")
    .withPositive("save")
    .withNegative("discard")
    .withBackground(Color.parseColor("#363636"))
    .withTextColor(Color.parseColor("#f5f5f5"))
    .withTitleColor(Color.WHITE)
    .setButtonListener(new ButtonListener() {

        @Override
        public void onPositive(MaterialTip tip) {
        	System.out.println("positive");
        }

        @Override
        public void onNegative(MaterialTip tip) {
        	System.out.println("negative");
        }

});

tip.show();

License

MIT - Francesco Cannizzaro

About

Android Library for prompt tip

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.