@@ -22,7 +22,8 @@ package, tasks and sdk on Android 9+ (Gingerbread or above) devices.
2222    6 .  [ DynamicTaskUtils] ( https://github.com/pranavpandey/dynamic-utils#dynamictaskutils ) 
2323    7 .  [ DynamicVersionUtils] ( https://github.com/pranavpandey/dynamic-utils#dynamicversionutils ) 
2424    8 .  [ DynamicWindowUtils] ( https://github.com/pranavpandey/dynamic-utils#dynamicwindowutils ) 
25-     9 .  [ Dependency] ( https://github.com/pranavpandey/dynamic-utils#dependency ) 
25+     9 .  [ DynamicUnitUtils] ( https://github.com/pranavpandey/dynamic-utils#dynamicwindowutils ) 
26+     10 .  [ Dependency] ( https://github.com/pranavpandey/dynamic-utils#dynamicunitutils ) 
26273 .  [ License] ( https://github.com/pranavpandey/dynamic-utils#license ) 
2728
2829--- 
@@ -33,7 +34,7 @@ It can be installed by adding the following dependency to your `build.gradle` fi
3334
3435``` groovy 
3536dependencies { 
36-     compile 'com.pranavpandey.android:dynamic-utils:0.2 .0' 
37+     compile 'com.pranavpandey.android:dynamic-utils:0.3 .0' 
3738} 
3839``` 
3940
@@ -49,109 +50,127 @@ for more hidden features.
4950
5051Helper class to change colors dynamically.
5152
52- 1 .  ` adjustAlpha(color, factor) `  - Adjust alpha of a color according to the given parameter.
53+ 1 .  ` @ColorInt int adjustAlpha(color, factor) `  - Adjust alpha of a color according to the given 
54+ parameter.
5355
54- 2 .  ` calculateContrast(color1, color2)  `  - Calculate color contrast difference between two  
55- colors based on luma value according to XYZ color space.
56+ 2 .  ` @ColorInt int  calculateContrast(color1, color2) `  - Calculate color contrast difference 
57+ between two  colors based on luma value according to XYZ color space.
5658
57- 3 .  ` getAccentColor(color) `  - Calculate accent color based on the given color for dynamic theme  
58- generation.
59+ 3 .  ` @ColorInt int  getAccentColor(color)`  - Calculate accent color based on the given color for 
60+ dynamic theme  generation.
5961
60- 4 .  ` getColorDarkness(color)  `  - Calculate darkness of a color.
62+ 4 .  ` @ColorInt int  getColorDarkness(color) `  - Calculate darkness of a color.
6163
62- 5 .  ` getContrastColor(color, contrastWithColor) `  - Calculate contrast of a color based on the given  
63- base color so that it will be visible always on top of the base color.
64+ 5 .  ` @ColorInt int  getContrastColor(color, contrastWithColor)`  - Calculate contrast of a color 
65+ based on the given  base color so that it will be visible always on top of the base color.
6466
65- 6 .  ` getLessVisibleColor(color) `  - Calculate less visible color of a given color.
67+ 6 .  ` @ColorInt int  getLessVisibleColor(color)`  - Calculate less visible color of a given color.
6668
67- 7 .  ` getTintColor(color) `  - Calculate tint based on a given color for better readability.
69+ 7 .  ` @ColorInt int getTintColor(color) `  - Calculate tint based on a given color for better 
70+ readability.
6871
69- 8 .  ` isColorDark(color) `  - Detect light or dark color.
72+ 8 .  ` boolean  isColorDark(color)`  - Detect light or dark color.
7073
71- 9 .  ` shiftColor(color, by) `  - Shift a color according to the given parameter.
74+ 9 .  ` @ColorInt int  shiftColor(color, by)`  - Shift a color according to the given parameter.
7275
7376### DynamicDeviceUtils  
7477
7578Helper class to detect device specific features like Telephony, etc.
7679
77- 1 .  ` hasTelephony(context) `  - To detect if device has telephony feature or not by using PackageManager.
80+ 1 .  ` boolean hasTelephony(context) `  - To detect if device has telephony feature or not by using 
81+ PackageManager.
7882
7983### DynamicDrawableUtils  
8084
8185Helper class to perform Drawable operations.
8286
83- 1 .  ` colorizeDrawable(drawable, wrap, color, mode) `  - Colorize and return the mutated drawable so that,  
84- all other references do not change.
87+ 1 .  ` void  colorizeDrawable(drawable, wrap, color, mode)`  - Colorize and return the mutated drawable 
88+ so that,  all other references do not change.
8589
86- 2 .  ` setBackground(view, drawable) `  - Set background of a given view in an efficient way by detecting  
87- the Android SDK at runtime.
90+ 2 .  ` Drawable  setBackground(view, drawable)`  - Set background of a given view in an efficient way 
91+ by detecting  the Android SDK at runtime.
8892
8993### DynamicLinkUtils  
9094
9195A collection of functions to perform various operations on the URL or to generate intents.
9296
93- 1 .  ` moreApps (context, publisher )`  - View other apps of a Publisher in the Google Play or Android  
94- Market .
97+ 1 .  ` void shareApp (context, title, message )`  - Share application via system default share intent  
98+ so that user can select from the available apps if more than one apps are available .
9599
96- 2 .  ` rateApp (context)`  - View app in the Google Play or Android Market.
100+ 2 .  ` void viewInGooglePlay (context, packageName )`  - View app in the Google Play or Android Market.
97101
98- 3 .  ` report (context, appName, email )`  - Ask questions or submit bug report to the developer via email .
102+ 3 .  ` void rateApp (context)`  - View app in the Google Play or Android Market .
99103
100- 4 .  ` shareApp (context, title, message )`  - Share application via system default share intent so that  
101- user can select from the available apps if more than one apps are available .
104+ 4 .  ` void moreApps (context, publisher )`  - View other apps of a Publisher in the Google Play  
105+ or Android Market .
102106
103- 5 .  ` viewInGooglePlay (context, packageName )`  - View app  in the Google Play  or Android Market .
107+ 5 .  ` void viewUrl (context, url )`  - View any URL  in the available app  or browser .
104108
105- 6 .  ` viewUrl(context, url) `  - View any URL in the available app or browser.
109+ 6 .  ` void report(context, appName, email) `  - Ask questions or submit bug report to the developer 
110+ via email.
106111
107112### DynamicPackageUtils  
108113
109114Helper class to get package or app related information.
110115
111- 1 .  ` getAppIcon (context)`  - Load application icon  from the given context.
116+ 1 .  ` ComponentName getComponentName (context)`  - Get component name  from the given context.
112117
113- 2 .  ` getAppLabel(context) `  - Get application label from the given context.
118+ 2 .  ` CharSequence  getAppLabel(context)`  - Get application label from the given context.
114119
115- 3 .  ` getAppVersion(context) `  - Get application version name from the given context.
120+ 3 .  ` String  getAppVersion(context)`  - Get application version name from the given context.
116121
117- 4 .  ` getComponentName (context)`  - Get component name  from the given context.
122+ 4 .  ` Drawable getAppIcon (context)`  - Load application icon  from the given context.
118123
119- 5 .  ` isSystemApp(applicationInfo) `  - To detect the given ApplicationInfo is a system app or not.
124+ 5 .  ` booelan isSystemApp(applicationInfo) `  - To detect the given ApplicationInfo is a system app 
125+ or not.
120126
121127### DynamicTaskUtils  
122128
123129Helper class to easily execute or cancel an AsyncTask by handling all the exceptions.
124130
125- 1 .  ` cancelTask(asyncTask) `  - Try to cancel the supplied AsyncTask.
131+ 1 .  ` void  cancelTask(asyncTask)`  - Try to cancel the supplied AsyncTask.
126132
127- 2 .  ` executeTask(asyncTask) `  - Try to execute the supplied AsyncTask.
133+ 2 .  ` void  executeTask(asyncTask)`  - Try to execute the supplied AsyncTask.
128134
129135### DynamicVersionUtils  
130136
131137Helper class to detect the Android SDK version at runtime so that we can provide the user 
132138experience accordingly.
133139
134- 1 .  ` isGingerbread() `  - To detect if the current Android version is Gingerbread or above.
140+ 1 .  ` boolean  isGingerbread()`  - To detect if the current Android version is Gingerbread or above.
135141
136- 2 .  ` isIceCreamSandwich() `  - To detect if the current Android version is Ice Cream Sandwich or above.
142+ 2 .  ` boolean isIceCreamSandwich() `  - To detect if the current Android version is Ice Cream Sandwich 
143+ or above.
137144
138145...
139146
140- 10 .  ` isNougat() `  - To detect if the current Android version is N or above.
147+ 10 .  ` boolean  isNougat()`  - To detect if the current Android version is N or above.
141148
142- 11 .  ` isNougatMR1() `  - To detect if the current Android version is N_MR1 or above.
149+ 11 .  ` boolean  isNougatMR1()`  - To detect if the current Android version is N_MR1 or above.
143150
144151### DynamicWindowUtils  
145152
146153Helper class to perform Window operations and to detect system configurations at runtime.
147154
148- 1 .  ` getAppUsableScreenSize(context) `  - Get the app usable screen size.
155+ 1 .  ` Point  getAppUsableScreenSize(context)`  - Get the app usable screen size.
149156
150- 2 .  ` getNavigationBarSize (context)`  - Get the on-screen navigation bar  size.
157+ 2 .  ` Point getRealScreenSize (context)`  - Get the real screen  size.
151158
152- 3 .  ` getRealScreenSize (context)`  - Get the real  screen size.
159+ 3 .  ` Point getNavigationBarSize (context)`  - Get the on- screen navigation bar  size.
153160
154- 4 .  ` isNavigationBarThemeSupported(context) `  - Detect support for navigation bar theme.
161+ 4 .  ` boolean isNavigationBarThemeSupported(context) `  - Detect support for navigation bar theme.
162+ 
163+ ### DynamicUnitUtils  
164+ 
165+ Helper class to perform unit conversions.
166+ 
167+ 1 .  ` int convertDpToPixels(dp) `  - To convert DP into pixels.
168+ 
169+ 2 .  ` int convertPixelsToDp(pixels) `  - To convert pixels into DP.
170+ 
171+ 3 .  ` int convertSpToPixels(sp) `  - To convert SP into pixels.
172+ 
173+ 4 .  ` int convertPixelsToSp(pixels) `  - To convert pixels into SP.
155174
156175### Dependency  
157176
0 commit comments