Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
Max Console
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amir Firdaus bin Samsudin
Max Console
Commits
4feab8cc
Commit
4feab8cc
authored
May 02, 2019
by
Amir Firdaus bin Samsudin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// PAYSLIP LATEST
parent
8d0a010a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
595 additions
and
363 deletions
+595
-363
build.gradle
app/build.gradle
+1
-0
PaySlipActivity.java
.../com/maxmoney/maxcddconsole/Activity/PaySlipActivity.java
+38
-34
PaySlipAdapter.java
...va/com/maxmoney/maxcddconsole/Adapter/PaySlipAdapter.java
+99
-0
PaySlipClass.java
...n/java/com/maxmoney/maxcddconsole/Class/PaySlipClass.java
+74
-0
custom_linear_dashboard_pay.xml
app/src/main/res/drawable/custom_linear_dashboard_pay.xml
+12
-0
activity_approve.xml
app/src/main/res/layout/activity_approve.xml
+5
-3
activity_pay_slip.xml
app/src/main/res/layout/activity_pay_slip.xml
+14
-326
list_payslip.xml
app/src/main/res/layout/list_payslip.xml
+351
-0
colors.xml
app/src/main/res/values/colors.xml
+1
-0
No files found.
app/build.gradle
View file @
4feab8cc
...
@@ -38,4 +38,5 @@ dependencies {
...
@@ -38,4 +38,5 @@ dependencies {
implementation
'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation
'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation
'com.jsibbold:zoomage:1.2.0-SNAPSHOT'
implementation
'com.jsibbold:zoomage:1.2.0-SNAPSHOT'
implementation
'com.github.chrisbanes:PhotoView:2.1.3'
implementation
'com.github.chrisbanes:PhotoView:2.1.3'
implementation
'com.android.support:recyclerview-v7:28.0.0'
}
}
app/src/main/java/com/maxmoney/maxcddconsole/Activity/PaySlipActivity.java
View file @
4feab8cc
...
@@ -3,8 +3,11 @@ package com.maxmoney.maxcddconsole.Activity;
...
@@ -3,8 +3,11 @@ package com.maxmoney.maxcddconsole.Activity;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.ListView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -13,6 +16,9 @@ import com.android.volley.RequestQueue;
...
@@ -13,6 +16,9 @@ import com.android.volley.RequestQueue;
import
com.android.volley.VolleyError
;
import
com.android.volley.VolleyError
;
import
com.android.volley.toolbox.StringRequest
;
import
com.android.volley.toolbox.StringRequest
;
import
com.android.volley.toolbox.Volley
;
import
com.android.volley.toolbox.Volley
;
import
com.maxmoney.maxcddconsole.Adapter.ApproveUserAdapter
;
import
com.maxmoney.maxcddconsole.Adapter.PaySlipAdapter
;
import
com.maxmoney.maxcddconsole.Class.PaySlipClass
;
import
com.maxmoney.maxcddconsole.Common.StandardProgressDialog
;
import
com.maxmoney.maxcddconsole.Common.StandardProgressDialog
;
import
com.maxmoney.maxcddconsole.Connectivity.BasedUrl
;
import
com.maxmoney.maxcddconsole.Connectivity.BasedUrl
;
import
com.maxmoney.maxcddconsole.R
;
import
com.maxmoney.maxcddconsole.R
;
...
@@ -21,7 +27,9 @@ import org.json.JSONArray;
...
@@ -21,7 +27,9 @@ import org.json.JSONArray;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
android
.
volley
.
Request
.
Method
.
GET
;
import
static
com
.
android
.
volley
.
Request
.
Method
.
GET
;
...
@@ -34,8 +42,9 @@ public class PaySlipActivity extends AppCompatActivity implements View.OnClickLi
...
@@ -34,8 +42,9 @@ public class PaySlipActivity extends AppCompatActivity implements View.OnClickLi
TextView
textView_title
;
TextView
textView_title
;
ImageView
imageView_back
;
ImageView
imageView_back
;
TextView
ids
,
name
,
overTimeInsideBranchHours
,
overTimeOutsideBranchHours
,
branchIncentive
,
allowance
,
corridorIncentive
,
private
PaySlipAdapter
mPLAdapter
;
individualIncentive
,
claims
,
deduction
,
netPay
,
basicPay
,
branch
;
RecyclerView
list_view
;
private
List
<
PaySlipClass
>
menuList
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -46,61 +55,56 @@ public class PaySlipActivity extends AppCompatActivity implements View.OnClickLi
...
@@ -46,61 +55,56 @@ public class PaySlipActivity extends AppCompatActivity implements View.OnClickLi
textView_title
=
findViewById
(
R
.
id
.
textView_title
);
textView_title
=
findViewById
(
R
.
id
.
textView_title
);
imageView_back
=
findViewById
(
R
.
id
.
imageView_back
);
imageView_back
=
findViewById
(
R
.
id
.
imageView_back
);
list_view
=
findViewById
(
R
.
id
.
list_view
);
ids
=
findViewById
(
R
.
id
.
ids
);
name
=
findViewById
(
R
.
id
.
name
);
overTimeInsideBranchHours
=
findViewById
(
R
.
id
.
overTimeInsideBranchHours
);
overTimeOutsideBranchHours
=
findViewById
(
R
.
id
.
overTimeOutsideBranchHours
);
branchIncentive
=
findViewById
(
R
.
id
.
branchIncentive
);
allowance
=
findViewById
(
R
.
id
.
allowance
);
corridorIncentive
=
findViewById
(
R
.
id
.
corridorIncentive
);
individualIncentive
=
findViewById
(
R
.
id
.
individualIncentive
);
claims
=
findViewById
(
R
.
id
.
claims
);
deduction
=
findViewById
(
R
.
id
.
deduction
);
netPay
=
findViewById
(
R
.
id
.
netPay
);
basicPay
=
findViewById
(
R
.
id
.
basicPay
);
branch
=
findViewById
(
R
.
id
.
branch
);
imageView_back
.
setOnClickListener
(
this
);
imageView_back
.
setOnClickListener
(
this
);
}
}
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
standardProgressDialog
.
show
();
standardProgressDialog
.
show
();
getDetails
();
getDetails
();
}
}
private
void
getDetails
()
{
private
void
getDetails
()
{
menuList
=
new
ArrayList
<>();
list_view
.
setNestedScrollingEnabled
(
false
);
list_view
.
setHasFixedSize
(
false
);
mPLAdapter
=
new
PaySlipAdapter
(
menuList
);
LinearLayoutManager
horizontalLayoutManager
=
new
LinearLayoutManager
(
PaySlipActivity
.
this
,
LinearLayoutManager
.
HORIZONTAL
,
false
);
list_view
.
setLayoutManager
(
horizontalLayoutManager
);
list_view
.
setAdapter
(
mPLAdapter
);
StringRequest
stringRequest
=
new
StringRequest
(
GET
,
BasedUrl
.
URL_STAGING
+
"pay-roll/my-pay-history"
,
StringRequest
stringRequest
=
new
StringRequest
(
GET
,
BasedUrl
.
URL_STAGING
+
"pay-roll/my-pay-history"
,
new
com
.
android
.
volley
.
Response
.
Listener
<
String
>()
{
new
com
.
android
.
volley
.
Response
.
Listener
<
String
>()
{
@Override
@Override
public
void
onResponse
(
final
String
response
)
{
public
void
onResponse
(
final
String
response
)
{
standardProgressDialog
.
dismiss
();
standardProgressDialog
.
dismiss
();
try
{
try
{
JSONArray
obj
=
new
JSONArray
(
response
);
JSONArray
obj
=
new
JSONArray
(
response
);
for
(
int
i
=
0
;
i
<
obj
.
length
();
i
++){
for
(
int
i
=
0
;
i
<
obj
.
length
();
i
++){
JSONObject
objs
=
obj
.
getJSONObject
(
i
);
JSONObject
objs
=
obj
.
getJSONObject
(
i
);
ids
.
setText
(
objs
.
getString
(
"id"
));
PaySlipClass
menuClass
=
new
PaySlipClass
(
name
.
setText
(
objs
.
getString
(
"name"
));
objs
.
getString
(
"createdAt"
),
overTimeInsideBranchHours
.
setText
(
objs
.
getString
(
"overTimeInsideBranchHours"
));
objs
.
getString
(
"branch"
),
overTimeOutsideBranchHours
.
setText
(
objs
.
getString
(
"overTimeOutsideBranchHours"
));
objs
.
getString
(
"corridor"
),
branchIncentive
.
setText
(
objs
.
getString
(
"branchIncentive"
));
objs
.
getString
(
"overTimeInsideBranch"
),
allowance
.
setText
(
objs
.
getString
(
"allowance"
));
objs
.
getString
(
"overTimeOutsideBranch"
),
corridorIncentive
.
setText
(
objs
.
getString
(
"corridorIncentive"
));
objs
.
getString
(
"branchIncentive"
),
individualIncentive
.
setText
(
objs
.
getString
(
"individualIncentive"
));
objs
.
getString
(
"corridorIncentive"
),
claims
.
setText
(
objs
.
getString
(
"claims"
));
objs
.
getString
(
"individualIncentive"
),
deduction
.
setText
(
objs
.
getString
(
"deduction"
));
objs
.
getString
(
"allowance"
),
netPay
.
setText
(
"RM "
+
objs
.
getString
(
"netPay"
));
objs
.
getString
(
"claims"
),
basicPay
.
setText
(
"RM "
+
objs
.
getString
(
"basicPay"
));
objs
.
getString
(
"deduction"
),
branch
.
setText
(
objs
.
getString
(
"branch"
));
objs
.
getString
(
"basicPay"
),
objs
.
getString
(
"netPay"
)
);
menuList
.
add
(
menuClass
);
}
}
mPLAdapter
.
notifyDataSetChanged
();
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
app/src/main/java/com/maxmoney/maxcddconsole/Adapter/PaySlipAdapter.java
0 → 100755
View file @
4feab8cc
package
com
.
maxmoney
.
maxcddconsole
.
Adapter
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.graphics.Color
;
import
android.graphics.Typeface
;
import
android.graphics.drawable.Drawable
;
import
android.support.annotation.NonNull
;
import
android.support.v7.widget.RecyclerView
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.maxmoney.maxcddconsole.Class.PaySlipClass
;
import
com.maxmoney.maxcddconsole.R
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
public
class
PaySlipAdapter
extends
RecyclerView
.
Adapter
<
PaySlipAdapter
.
MyViewHolder
>
{
private
List
<
PaySlipClass
>
menuList
;
public
class
MyViewHolder
extends
RecyclerView
.
ViewHolder
{
public
TextView
tv1
,
tv2
,
tv3
,
tv4
,
tv5
,
tv6
,
tv7
,
tv8
,
tv9
,
tv10
,
tv11
,
tv12
,
tv13
;
LinearLayout
linear_all
;
public
MyViewHolder
(
View
view
)
{
super
(
view
);
tv1
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_1
);
tv2
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_2
);
tv3
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_3
);
tv4
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_4
);
tv5
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_5
);
tv6
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_6
);
tv7
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_7
);
tv8
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_8
);
tv9
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_9
);
tv10
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_10
);
tv11
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_11
);
tv12
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_12
);
tv13
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
textView_13
);
linear_all
=
view
.
findViewById
(
R
.
id
.
linear_all
);
}
}
public
PaySlipAdapter
(
List
<
PaySlipClass
>
menuList
)
{
this
.
menuList
=
menuList
;
}
@Override
public
MyViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
itemView
=
LayoutInflater
.
from
(
parent
.
getContext
())
.
inflate
(
R
.
layout
.
list_payslip
,
parent
,
false
);
return
new
MyViewHolder
(
itemView
);
}
@Override
public
void
onBindViewHolder
(
MyViewHolder
holder
,
int
position
)
{
PaySlipClass
menu
=
menuList
.
get
(
position
);
holder
.
tv1
.
setText
(
menu
.
getTv1
());
holder
.
tv2
.
setText
(
menu
.
getTv2
());
holder
.
tv3
.
setText
(
menu
.
getTv3
());
holder
.
tv4
.
setText
(
menu
.
getTv4
());
holder
.
tv5
.
setText
(
menu
.
getTv5
());
holder
.
tv6
.
setText
(
menu
.
getTv6
());
holder
.
tv7
.
setText
(
menu
.
getTv7
());
holder
.
tv8
.
setText
(
menu
.
getTv8
());
holder
.
tv9
.
setText
(
menu
.
getTv9
());
holder
.
tv10
.
setText
(
menu
.
getTv10
());
holder
.
tv11
.
setText
(
menu
.
getTv11
());
holder
.
tv12
.
setText
(
menu
.
getTv12
());
holder
.
tv13
.
setText
(
menu
.
getTv13
());
if
(
position
%
2
==
0
){
Log
.
d
(
"yaw"
,
"yaw"
);
holder
.
linear_all
.
setBackgroundColor
(
Color
.
parseColor
(
"#BBDEFB"
));
}
else
{
Log
.
d
(
"yaw"
,
"yaws"
);
holder
.
linear_all
.
setBackgroundColor
(
Color
.
parseColor
(
"#FFFFFF"
));
}
}
@Override
public
int
getItemCount
()
{
return
menuList
.
size
();
}
}
app/src/main/java/com/maxmoney/maxcddconsole/Class/PaySlipClass.java
0 → 100644
View file @
4feab8cc
package
com
.
maxmoney
.
maxcddconsole
.
Class
;
public
class
PaySlipClass
{
private
String
tv1
,
tv2
,
tv3
,
tv4
,
tv5
,
tv6
,
tv7
,
tv8
,
tv9
,
tv10
,
tv11
,
tv12
,
tv13
;
public
PaySlipClass
(
String
tv1
,
String
tv2
,
String
tv3
,
String
tv4
,
String
tv5
,
String
tv6
,
String
tv7
,
String
tv8
,
String
tv9
,
String
tv10
,
String
tv11
,
String
tv12
,
String
tv13
)
{
this
.
tv1
=
tv1
;
this
.
tv2
=
tv2
;
this
.
tv3
=
tv3
;
this
.
tv4
=
tv4
;
this
.
tv5
=
tv5
;
this
.
tv6
=
tv6
;
this
.
tv7
=
tv7
;
this
.
tv8
=
tv8
;
this
.
tv9
=
tv9
;
this
.
tv10
=
tv10
;
this
.
tv11
=
tv11
;
this
.
tv12
=
tv12
;
this
.
tv13
=
tv13
;
}
public
String
getTv1
()
{
return
tv1
;
}
public
String
getTv2
()
{
return
tv2
;
}
public
String
getTv3
()
{
return
tv3
;
}
public
String
getTv4
()
{
return
tv4
;
}
public
String
getTv5
()
{
return
tv5
;
}
public
String
getTv6
()
{
return
tv6
;
}
public
String
getTv7
()
{
return
tv7
;
}
public
String
getTv8
()
{
return
tv8
;
}
public
String
getTv9
()
{
return
tv9
;
}
public
String
getTv10
()
{
return
tv10
;
}
public
String
getTv11
()
{
return
tv11
;
}
public
String
getTv12
()
{
return
tv12
;
}
public
String
getTv13
()
{
return
tv13
;
}
}
app/src/main/res/drawable/custom_linear_dashboard_pay.xml
0 → 100755
View file @
4feab8cc
<?xml version="1.0" encoding="utf-8" ?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:thickness=
"1dp"
android:shape=
"rectangle"
>
<corners
android:radius=
"15dp"
/>
<gradient
android:startColor=
"#6EB4E7"
android:endColor=
"#679CC2"
/>
<stroke
android:width=
"1dp"
android:color=
"#FFFFFF"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_approve.xml
View file @
4feab8cc
...
@@ -77,9 +77,11 @@
...
@@ -77,9 +77,11 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<
List
View
<
android.support.v7.widget.Recycler
View
android:id=
"@+id/
list_view
"
android:id=
"@+id/
rc
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
></ListView>
android:layout_height=
"match_parent"
android:layout_margin=
"10dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_pay_slip.xml
View file @
4feab8cc
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/list_payslip.xml
0 → 100755
View file @
4feab8cc
This diff is collapsed.
Click to expand it.
app/src/main/res/values/colors.xml
View file @
4feab8cc
...
@@ -5,4 +5,5 @@
...
@@ -5,4 +5,5 @@
<color
name=
"colorAccent"
>
#D81B60
</color>
<color
name=
"colorAccent"
>
#D81B60
</color>
<color
name=
"colorBackground"
>
#2C84C4
</color>
<color
name=
"colorBackground"
>
#2C84C4
</color>
<color
name=
"colorButtonHijau"
>
#39B449
</color>
<color
name=
"colorButtonHijau"
>
#39B449
</color>
<color
name=
"colorSIkit"
>
#EEEEEE
</color>
</resources>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment