This project was created during my internship @dcodermobile . I am open sourcing it to give back to community.
Download Dcoder app for Android
A language drawable generator like GitHub in Android.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.avishekdas128:Language-Drawbale:0.1.3'
}
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.