Skip to content

avishekdas128/Language-Drawbale

Repository files navigation

This project was created during my internship @dcodermobile . I am open sourcing it to give back to community.
Download Dcoder app for Android

Language Drawable

A language drawable generator like GitHub in Android.

Screenshots

Screenshot_1

Screenshot_2

How to implement in your project

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

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

Add the dependency in your app build.gradle

dependencies {
	implementation 'com.github.avishekdas128:Language-Drawbale:0.1.3'
}

Now in your Java code,

languageLayout = findViewById(R.id.language_layout);

//The language model takes the fraction of the language and color.
languageList = new ArrayList<>();
languageList.add(new LanguageModel(.2f, Color.RED));
languageList.add(new LanguageModel(.1f, Color.GREEN));
languageList.add(new LanguageModel(.4f, Color.BLUE));
languageList.add(new LanguageModel(.3f, Color.BLACK));
  
languageLayout.setBackground(new LanguageDrawable(languageList));

That's it. You've added a GitHub like different language drawable.

About

GitHub like language drawable for Android.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages