-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.txt
More file actions
77 lines (52 loc) · 1.51 KB
/
README.txt
File metadata and controls
77 lines (52 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
base-utils
To setup the library:
1. In your root build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
2. In your app build.gradle
dependencies {
implementation 'com.github.hzaun:base-utils:v1.0.2'
}
How to use::
activity_main.xml
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".StartingPoint">
<include
android:id="@+id/toolbar"
layout="@layout/hzaun_toolbar" />
...
</android.support.constraint.ConstraintLayout>
MainActivity.class
public class MainActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_starting_point);
super.onCreate(savedInstanceState);
}
@Override
public void initApp() {
super.initApp();
context = this;
uiComponents = new UIComponents(context, true);
uiComponents.setToolbarItems(R.drawable.ic_menu, R.string.activity_main);
baseUtils = new BaseUtils(context);
}
public void fetchData() {
if (baseUtils.isOnline()) {
baseUtils.getLoader();
// call API
}
}
public void parseData() {
baseUtils.dismissLoader();
...
}
}