Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Talking Reminder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RAUSHAN RAJ
Talking Reminder
Commits
0d89253f
Commit
0d89253f
authored
Nov 05, 2019
by
DEEPAK VERMA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parsing and putting done.
Save and Discard button have to add.
parent
520ed45a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
10 deletions
+45
-10
app/src/main/java/com/blanyal/remindme/ReminderEditActivity.java
.../main/java/com/blanyal/remindme/ReminderEditActivity.java
+5
-3
app/src/main/java/com/blanyal/remindme/ReminderReceiveActivity.java
...in/java/com/blanyal/remindme/ReminderReceiveActivity.java
+40
-7
No files found.
app/src/main/java/com/blanyal/remindme/ReminderEditActivity.java
View file @
0d89253f
...
@@ -132,16 +132,18 @@ public class ReminderEditActivity extends AppCompatActivity {
...
@@ -132,16 +132,18 @@ public class ReminderEditActivity extends AppCompatActivity {
// Get reminder using reminder id
// Get reminder using reminder id
rb
=
new
ReminderDatabase
(
this
);
rb
=
new
ReminderDatabase
(
this
);
Intent
intent
=
getIntent
();
/*Intent intent = getIntent();
if(intent.getType().equals("text/"+Utility.FILE_EXTENSION)){
if(intent.getType().equals("text/"+Utility.FILE_EXTENSION)){
mReceivedReminder.setTitle(intent.getStringExtra("mTitle"));
mReceivedReminder.setTitle(intent.getStringExtra("mTitle"));
System.out.println("**********************************");
System.out.println("**********************************");
System.out.println(mReceivedReminder.getTitle());
System.out.println(mReceivedReminder.getTitle());
System.out.println("**********************************");
System.out.println("**********************************");
}
}
else
{
else {*/
// Get reminder id from intent
mReceivedReminder
=
rb
.
getReminder
(
mReceivedID
);
mReceivedReminder
=
rb
.
getReminder
(
mReceivedID
);
}
//
}
// Get values from reminder
// Get values from reminder
mTitle
=
mReceivedReminder
.
getTitle
();
mTitle
=
mReceivedReminder
.
getTitle
();
...
...
app/src/main/java/com/blanyal/remindme/ReminderReceiveActivity.java
View file @
0d89253f
...
@@ -7,14 +7,21 @@ import android.content.Context;
...
@@ -7,14 +7,21 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
org.json.JSONObject
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
import
java.io.InputStream
;
public
class
ReminderReceiveActivity
extends
AppCompatActivity
{
public
class
ReminderReceiveActivity
extends
AppCompatActivity
{
private
Toolbar
mToolbar
;
private
Toolbar
mToolbar
;
private
EditText
mTitleText
;
private
TextView
mDateText
,
mTimeText
,
mRepeatText
,
mRepeatNoText
,
mRepeatTypeText
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -28,24 +35,50 @@ public class ReminderReceiveActivity extends AppCompatActivity {
...
@@ -28,24 +35,50 @@ public class ReminderReceiveActivity extends AppCompatActivity {
//Get the file from intent
//Get the file from intent
Intent
intent
=
getIntent
();
Intent
intent
=
getIntent
();
Uri
fileUri
=
intent
.
getData
();
Uri
fileUri
=
intent
.
getData
();
StringBuilder
reminderJson
=
new
StringBuilder
();
if
(
intent
.
getType
().
equals
(
"text/"
+
Utility
.
FILE_EXTENSION
))
{
if
(
intent
.
getType
().
equals
(
"text/"
+
Utility
.
FILE_EXTENSION
))
{
try
{
try
{
InputStream
in
=
getContentResolver
().
openInputStream
(
fileUri
);
InputStream
in
=
getContentResolver
().
openInputStream
(
fileUri
);
int
i
;
int
i
;
StringBuilder
sb
=
new
StringBuilder
();
while
((
i
=
in
.
read
())
!=
-
1
)
while
((
i
=
in
.
read
())
!=
-
1
)
sb
.
append
((
char
)
i
);
reminderJson
.
append
((
char
)
i
);
System
.
out
.
println
(
"******************************************************************"
);
//
System.out.println("******************************************************************");
System
.
out
.
println
(
sb
.
toString
());
//
System.out.println(sb.toString());
System
.
out
.
println
(
"******************************************************************"
);
//
System.out.println("******************************************************************");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
Intent
senderIntent
=
new
Intent
(
context
,
ReminderEditActivity
.
class
);
try
{
JSONObject
obj
=
new
JSONObject
(
reminderJson
.
toString
());
//Reminder talkingReminder=new Reminder();
mTitleText
=
(
EditText
)
findViewById
(
R
.
id
.
reminder_title
);
mDateText
=
(
TextView
)
findViewById
(
R
.
id
.
set_date
);
mTimeText
=
(
TextView
)
findViewById
(
R
.
id
.
set_time
);
mRepeatText
=
(
TextView
)
findViewById
(
R
.
id
.
set_repeat
);
mRepeatNoText
=
(
TextView
)
findViewById
(
R
.
id
.
set_repeat_no
);
mRepeatTypeText
=
(
TextView
)
findViewById
(
R
.
id
.
set_repeat_type
);
mTitleText
.
setText
(
obj
.
getString
(
"mTitle"
));
mDateText
.
setText
(
obj
.
getString
(
"mDate"
));
mTimeText
.
setText
(
obj
.
getString
(
"mTime"
));
mRepeatText
.
setText
(
"Every "
+
obj
.
getString
(
"mRepeatNo"
)+
" "
+
obj
.
getString
(
"mRepeatType"
)+
"(s)"
);
mRepeatNoText
.
setText
(
obj
.
getString
(
"mRepeatNo"
));
mRepeatTypeText
.
setText
(
obj
.
getString
(
"mRepeatType"
));
}
catch
(
Throwable
t
){
t
.
printStackTrace
();
}
/*Intent senderIntent = new Intent(context, ReminderEditActivity.class);
senderIntent.putExtra("received", true);
senderIntent.putExtra("received", true);
senderIntent.putExtra("mTitle", "First Receive Reminder test");
senderIntent.putExtra("mTitle", "First Receive Reminder test");
startActivity
(
senderIntent
);
startActivity(senderIntent);
*/
}
}
}
}
}
}
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