Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parkingo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SHAILESH KUMAR
parkingo
Commits
59275085
Commit
59275085
authored
Nov 27, 2019
by
Bhavesh Yadav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added wallet topup feature - offline
parent
14d37d61
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
150 additions
and
91 deletions
+150
-91
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
app/src/main/java/com/example/infiniteLoop/parkingo/login_activity.java
...ava/com/example/infiniteLoop/parkingo/login_activity.java
+2
-1
app/src/main/java/com/example/infiniteLoop/parkingo/sqlite_ops.java
...in/java/com/example/infiniteLoop/parkingo/sqlite_ops.java
+1
-1
app/src/main/java/com/example/infiniteLoop/parkingo/userInfo.java
...main/java/com/example/infiniteLoop/parkingo/userInfo.java
+5
-0
app/src/main/java/com/example/infiniteLoop/parkingo/wallets.java
.../main/java/com/example/infiniteLoop/parkingo/wallets.java
+53
-1
app/src/main/res/layout/activity_wallets.xml
app/src/main/res/layout/activity_wallets.xml
+87
-87
No files found.
app/src/main/AndroidManifest.xml
View file @
59275085
...
...
@@ -11,7 +11,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/appTheme"
>
<activity
android:name=
"com.example.infiniteLoop.parkingo.wallets"
></activity>
<activity
android:name=
"com.example.infiniteLoop.parkingo.wallets"
android:theme=
"@style/Theme.AppCompat"
></activity>
<activity
android:name=
"com.example.infiniteLoop.parkingo.SplashActivity"
android:theme=
"@style/splash_screen"
>
...
...
app/src/main/java/com/example/infiniteLoop/parkingo/login_activity.java
View file @
59275085
...
...
@@ -142,7 +142,8 @@ public class login_activity extends Activity {
progress
.
dismiss
();
uinfo
.
setU_name
(
user
.
get
(
"name"
).
toString
());
uinfo
.
setUsername
(
user
.
get
(
"username"
).
toString
());
if
(
user
.
get
(
"balance"
)!=
null
)
uinfo
.
setBalance
(
Integer
.
parseInt
(
user
.
get
(
"balance"
).
toString
()));
Toast
.
makeText
(
login_activity
.
this
,
"Login_Success"
,
Toast
.
LENGTH_SHORT
).
show
();
startActivity
(
new
Intent
(
login_activity
.
this
,
dashboard
.
class
));
...
...
app/src/main/java/com/example/infiniteLoop/parkingo/sqlite_ops.java
View file @
59275085
...
...
@@ -67,7 +67,7 @@ public class sqlite_ops extends SQLiteOpenHelper{
public
void
initFirebase
()
{
//AddSlotsToFirebase();
fdb
=
FirebaseFirestore
.
getInstance
();
//
AddSlotsToFirebase();
// AddSlotsToFirebase();
}
public
void
AddSlotsToFirebase
()
{
...
...
app/src/main/java/com/example/infiniteLoop/parkingo/userInfo.java
View file @
59275085
...
...
@@ -14,6 +14,7 @@ public class userInfo {
Log
.
d
(
"ins"
,
"called"
);
return
u_instance
;
}
private
int
balance
=
0
;
public
String
getName
()
{
return
u_name
;
...
...
@@ -30,4 +31,8 @@ public class userInfo {
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
int
getBalance
(){
return
this
.
balance
;}
public
void
setBalance
(
int
newBalance
){
this
.
balance
=
newBalance
;}
}
app/src/main/java/com/example/infiniteLoop/parkingo/wallets.java
View file @
59275085
package
com.example.infiniteLoop.parkingo
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.text.InputType
;
import
android.view.View
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.cardview.widget.CardView
;
import
io.opencensus.internal.StringUtils
;
public
class
wallets
extends
Activity
{
String
top_up_text
;
TextView
wdraw
;
TextView
balance
;
CardView
topupButton
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_wallets
);
TextView
wdraw
=
findViewById
(
R
.
id
.
uname
);
wdraw
=
findViewById
(
R
.
id
.
uname
);
balance
=
findViewById
(
R
.
id
.
balance_amount
);
topupButton
=
findViewById
(
R
.
id
.
topup
);
userInfo
uinfo
=
userInfo
.
getInstance
();
balance
.
setText
(
"\u20B9 "
+
uinfo
.
getBalance
());
wdraw
.
setText
(
"Hello "
.
toUpperCase
()+
uinfo
.
getName
().
toUpperCase
());
topupButton
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
)
{
top_up
();
}
});
}
private
void
top_up
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setTitle
(
"Enter amount to top up with"
);
final
EditText
input
=
new
EditText
(
this
);
input
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
|
InputType
.
TYPE_CLASS_NUMBER
);
builder
.
setView
(
input
);
builder
.
setPositiveButton
(
"ADD"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
top_up_text
=
input
.
getText
().
toString
();
userInfo
uinfo
=
userInfo
.
getInstance
();
int
newBalance
=
Integer
.
parseInt
(
top_up_text
)+
uinfo
.
getBalance
();
uinfo
.
setBalance
(
newBalance
);
balance
.
setText
(
"\u20B9 "
+
uinfo
.
getBalance
());
}
});
builder
.
setNegativeButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
cancel
();
}
});
builder
.
show
();
}
}
app/src/main/res/layout/activity_wallets.xml
View file @
59275085
...
...
@@ -63,48 +63,6 @@
</TextView>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/transactions"
android:layout_width=
"match_parent"
android:layout_height=
"70dp"
android:layout_column=
"1"
android:layout_margin=
"10dp"
android:layout_marginTop=
"50dp"
android:paddingLeft=
"10dp"
android:paddingTop=
"0dp"
android:paddingRight=
"10dp"
android:paddingBottom=
"5dp"
app:cardBackgroundColor=
"#fff"
app:cardElevation=
"15dp"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:textSize=
"25dp"
android:text=
"\u2022 Transactions"
android:textColor=
"#000"
android:paddingLeft=
"25dp"
android:textColorHighlight=
"#00f"
android:textColorLink=
"@color/black"
android:shadowColor=
"#000"
android:outlineSpotShadowColor=
"#000"
>
</TextView>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right|center_vertical"
android:text=
"view"
android:layout_marginEnd=
"20dp"
android:background=
"#fff"
android:padding=
"10dp"
android:textSize=
"20dp"
></TextView>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/topup"
...
...
@@ -125,7 +83,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:textSize=
"25dp"
android:text=
"\u2022 Top-
U
p"
android:text=
"\u2022 Top-
u
p"
android:textColor=
"#000"
android:paddingLeft=
"25dp"
android:textColorHighlight=
"#00f"
...
...
@@ -148,50 +106,92 @@
></TextView>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id=
"@+id/withdraw"
android:layout_width=
"match_parent"
android:layout_height=
"70dp"
android:layout_column=
"1"
android:layout_margin=
"10dp"
android:layout_marginTop=
"50dp"
android:paddingLeft=
"10dp"
android:paddingTop=
"0dp"
android:paddingRight=
"10dp"
android:paddingBottom=
"5dp"
app:cardBackgroundColor=
"#fff"
app:cardElevation=
"15dp"
>
<TextView
android:id=
"@+id/wdraw_txt"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:textSize=
"25dp"
android:text=
"\u2022 Withdraw Money"
android:textColor=
"#000"
android:paddingLeft=
"25dp"
android:textColorHighlight=
"#00f"
android:textColorLink=
"@color/black"
android:shadowColor=
"#000"
android:outlineSpotShadowColor=
"#000"
>
</TextView>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right|center_vertical"
android:text=
"view"
android:layout_marginEnd=
"20dp"
android:background=
"#fff"
android:padding=
"10dp"
android:textSize=
"20dp"
></TextView>
</androidx.cardview.widget.CardView>
<!-- <androidx.cardview.widget.CardView-->
<!-- android:id="@+id/topup"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="70dp"-->
<!-- android:layout_column="1"-->
<!-- android:layout_margin="10dp"-->
<!-- android:layout_marginTop="50dp"-->
<!-- android:paddingLeft="10dp"-->
<!-- android:paddingTop="0dp"-->
<!-- android:paddingRight="10dp"-->
<!-- android:paddingBottom="5dp"-->
<!-- app:cardBackgroundColor="#fff"-->
<!-- app:cardElevation="15dp"-->
<!-- >-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center_vertical"-->
<!-- android:textSize="25dp"-->
<!-- android:text="\u2022 Top-Up"-->
<!-- android:textColor="#000"-->
<!-- android:paddingLeft="25dp"-->
<!-- android:textColorHighlight="#00f"-->
<!-- android:textColorLink="@color/black"-->
<!-- android:shadowColor="#000"-->
<!-- android:outlineSpotShadowColor="#000"-->
<!-- >-->
<!-- </TextView>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="right|center_vertical"-->
<!-- android:text="view"-->
<!-- android:layout_marginEnd="20dp"-->
<!-- android:background="#fff"-->
<!-- android:padding="10dp"-->
<!-- android:textSize="20dp"-->
<!-- ></TextView>-->
<!-- </androidx.cardview.widget.CardView>-->
<!-- <androidx.cardview.widget.CardView-->
<!-- android:id="@+id/withdraw"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="70dp"-->
<!-- android:layout_column="1"-->
<!-- android:layout_margin="10dp"-->
<!-- android:layout_marginTop="50dp"-->
<!-- android:paddingLeft="10dp"-->
<!-- android:paddingTop="0dp"-->
<!-- android:paddingRight="10dp"-->
<!-- android:paddingBottom="5dp"-->
<!-- app:cardBackgroundColor="#fff"-->
<!-- app:cardElevation="15dp"-->
<!-- >-->
<!-- <TextView-->
<!-- android:id="@+id/wdraw_txt"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="center_vertical"-->
<!-- android:textSize="25dp"-->
<!-- android:text="\u2022 Withdraw Money"-->
<!-- android:textColor="#000"-->
<!-- android:paddingLeft="25dp"-->
<!-- android:textColorHighlight="#00f"-->
<!-- android:textColorLink="@color/black"-->
<!-- android:shadowColor="#000"-->
<!-- android:outlineSpotShadowColor="#000"-->
<!-- >-->
<!-- </TextView>-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="right|center_vertical"-->
<!-- android:text="view"-->
<!-- android:layout_marginEnd="20dp"-->
<!-- android:background="#fff"-->
<!-- android:padding="10dp"-->
<!-- android:textSize="20dp"-->
<!-- ></TextView>-->
<!-- </androidx.cardview.widget.CardView>-->
...
...
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