Skip to content

Commit 44cdbd8

Browse files
committed
1. Added new date time utils for date time formatting.
2. Added device utils for getting device info. 3. Added custom progress bar, expandable list and grid view.
1 parent b4bf581 commit 44cdbd8

File tree

15 files changed

+636
-1093
lines changed

15 files changed

+636
-1093
lines changed
0 Bytes
Binary file not shown.

app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ apply plugin: 'com.github.dcendents.android-maven'
44
group = 'com.github.amitjangid80'
55

66
android {
7-
compileSdkVersion 27
7+
compileSdkVersion 28
88
defaultConfig {
99
minSdkVersion 19
10-
targetSdkVersion 27
11-
versionCode 1
12-
versionName "1.0"
10+
targetSdkVersion 28
11+
versionCode 25 // this indicates the number of releases of library
12+
versionName "1.2.18" // this indicates the current version of library
1313
}
1414
buildTypes {
1515
release {
@@ -25,7 +25,7 @@ repositories {
2525

2626
dependencies {
2727
implementation fileTree(include: ['*.jar'], dir: 'libs')
28-
implementation 'com.android.support:appcompat-v7:27.1.1'
29-
implementation 'com.android.support:design:27.1.1'
30-
implementation 'com.android.support:cardview-v7:27.1.1'
28+
implementation 'com.android.support:appcompat-v7:28.0.0'
29+
implementation 'com.android.support:design:28.0.0'
30+
implementation 'com.android.support:cardview-v7:28.0.0'
3131
}

app/src/main/java/com/amit/api/ApiServices.java

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package com.amit.api;
22

3-
import android.annotation.SuppressLint;
43
import android.content.Context;
54
import android.graphics.Bitmap;
65
import android.graphics.BitmapFactory;
7-
import android.os.Build;
8-
import android.provider.Settings.Secure;
6+
import android.support.annotation.NonNull;
97
import android.support.v4.util.Pair;
108
import android.util.Log;
119

@@ -24,77 +22,21 @@
2422
* 2018 April 17 - Tuesday - 12:56 PM
2523
**/
2624
@SuppressWarnings("unused")
27-
@SuppressLint("HardwareIds")
2825
public class ApiServices
2926
{
3027
private static final String TAG = ApiServices.class.getSimpleName();
3128

32-
private String apiPath, mDeviceID;
29+
private String apiPath;
3330
private SharedPreferenceData sharedPreferenceData;
3431

35-
public ApiServices(Context context)
32+
public ApiServices(@NonNull Context context)
3633
{
3734
this.sharedPreferenceData = new SharedPreferenceData(context);
3835

3936
// set api path before using it
4037
// this path will consist of the url which is repeated in every api
4138
// Ex: http://www.example.com/api/
4239
this.apiPath = sharedPreferenceData.getValue("apiPath");
43-
44-
// this will get the device id of the device
45-
this.mDeviceID = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);
46-
}
47-
48-
public String getDeviceID()
49-
{
50-
return mDeviceID;
51-
}
52-
53-
/**
54-
* get device name method
55-
*
56-
* this method will get the name of the device
57-
**/
58-
public String getDeviceName()
59-
{
60-
String manufacturer = Build.MANUFACTURER;
61-
String model = Build.MODEL;
62-
63-
if (model.startsWith(manufacturer))
64-
{
65-
return capitalizeString(model);
66-
}
67-
else
68-
{
69-
return capitalizeString(manufacturer + " " + model);
70-
}
71-
}
72-
73-
/**
74-
* capitalizeString method
75-
*
76-
* this method will capitalizeString or set the string to upper case
77-
*
78-
* @param string - string to capitalize
79-
* return - will return the string which was passed in capitalize form
80-
**/
81-
private String capitalizeString(String string)
82-
{
83-
if (string == null || string.length() == 0)
84-
{
85-
return "";
86-
}
87-
88-
char first = string.charAt(0);
89-
90-
if (Character.isUpperCase(first))
91-
{
92-
return string;
93-
}
94-
else
95-
{
96-
return Character.toUpperCase(first) + string.substring(1);
97-
}
9840
}
9941

10042
/**
@@ -224,15 +166,19 @@ public Pair<Integer, String> makeAPICall(final String apiName, final String requ
224166
*
225167
* @param apiPath - this parameter will contain the apiPath where the image has to be downloaded
226168
* this apiPath parameter will contain the entire path for the image to be downloaded.
169+
*
227170
* @param requestType - request type will be GET OR POST
171+
*
228172
* @param parameter - if any information has to be sent in body then set parameters
229173
* use json object for this parameter.
230174
*
231175
* return - pair of integer and bitmap value
232176
* where integer will be the response code
233177
* and bitmap will be the file uploaded.
234178
*
179+
* will be removed in next release
235180
**/
181+
@Deprecated
236182
public Pair<Integer, Bitmap> getBitmapImageFromServer(String apiPath, String requestType, String parameter)
237183
{
238184
Bitmap resultVal = null;

app/src/main/java/com/amit/datetime/DateTimeFormat.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

app/src/main/java/com/amit/datetime/DateTimeStyle.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

app/src/main/java/com/amit/datetime/DateTimeUnits.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)