-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
> This project was created during my internship <a href="https://dcoder.tech/" target="_blank">@dcodermobile</a> | ||
<kbd><img src="https://play-lh.googleusercontent.com/PWUsRLZ8fawBOdTjMrSWwa6-EBpzOguNIlvqxepMRFmBD8eTq8UPGj2241I2qFF1Eg=s360-rw" width="14" height="14" /></kbd>. | ||
I am open sourcing it to give back to community. | ||
> <br/><a href="https://play.google.com/store/apps/details?id=com.paprbit.dcoder" target="_blank">Download Dcoder app for Android</a> | ||
# Language Drawable [![](https://jitpack.io/v/avishekdas128/Language-Drawbale.svg)](https://jitpack.io/#avishekdas128/Language-Drawbale) | ||
A language drawable generator like GitHub in Android. | ||
|
||
## Screenshots | ||
![Screenshot_1](https://user-images.githubusercontent.com/43132866/106358279-41000600-6331-11eb-950e-58c18d01ab5a.png) | ||
|
||
![Screenshot_2](https://user-images.githubusercontent.com/43132866/106358280-42313300-6331-11eb-8fa6-5c7cb81ee41d.png) | ||
|
||
|
||
## 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.0' | ||
} | ||
``` | ||
### Now in your Java code, | ||
```JAVA | ||
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. |