Re: [android-developers] No data shown in my Recyclerview

2016-12-02 Thread Chie Paliza
Yes I have. I already retrieve the data when the date is the same on the 
today's date. But when the date is weekly no data retrieve

On Saturday, December 3, 2016 at 1:32:16 AM UTC+8, Marina Cuello wrote:
>
> Hi! Are you calling recyclerView.setLayoutManager(somelayout) somewhere 
> outside the code you pasted?
>
> "In contrast to other adapter-backed views such as ListView 
>  or 
> GridView 
> , 
> RecyclerView allows client code to provide custom layout arrangements for 
> child views. These arrangements are controlled by the 
> RecyclerView.LayoutManager 
> .
>  
> A LayoutManager must be provided for RecyclerView to function."
>
> Marina
>
> On Fri, Dec 2, 2016 at 2:06 PM, Chie Paliza  > wrote:
>
>> Im creating budgeting app. And I want to see the expenses of the user 
>> weekly but I have a problem, Im getting first the date and compare it in 
>> the dates in that week but no data 
>> shown in my recyclerview. This is my code: 
>>
>> recyclerView.requestLayout();
>> Log.e("myFirebaseData", "'" + month);
>> adapter.cleanup();
>>
>>
>> adapter = new FirebaseRecyclerAdapter(
>> ExpenseData.class, R.layout.listitem, myViewHolder.class, 
>> mRef.orderByChild("date")) {
>>
>>
>> @Override
>> protected void populateViewHolder(final myViewHolder viewHolder, 
>> ExpenseData model, final int position) {
>>
>>
>>java.util.Calendar c = Calendar.getInstance();
>> DateFormat format = new SimpleDateFormat(" 
>> dd, ", Locale.ENGLISH);
>> c.setFirstDayOfWeek(Calendar.SUNDAY);
>> c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
>>
>>
>> String[] days = new String[7];
>> for (int i = 0; i < 7; i++) {
>> Log.e("dateTag", format.format(c.getTime()));
>> days[i] = format.format(c.getTime());
>> c.add(Calendar.DAY_OF_MONTH, 1);
>>
>> String checkDate = model.getDate();
>> if (checkDate.contentEquals(days[i])) {
>>   
>>
>> 
>> viewHolder.DateText.setText(model.getDate());
>> 
>> viewHolder.ExpenseTitleText.setText(model.getExpensetitle());
>> 
>> viewHolder.AmountText.setText(String.valueOf(String.format("%.2f", 
>> model.getAmount(;
>> }
>> }
>> }
>>
>> };
>>
>>
>> recyclerView.setAdapter(adapter);
>>
>>
>> }
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-developers+unsubscr...@googlegroups.com .
>> To post to this group, send email to android-d...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/android-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/android-developers/5c519fcd-837b-46d1-b0f2-51b73fda5098%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/5b156bbd-7560-46d3-9bc5-293dc5101052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] No data shown in my Recyclerview

2016-12-02 Thread Marina Cuello
Hi! Are you calling recyclerView.setLayoutManager(somelayout) somewhere
outside the code you pasted?

"In contrast to other adapter-backed views such as ListView
 or
GridView
,
RecyclerView allows client code to provide custom layout arrangements for
child views. These arrangements are controlled by the
RecyclerView.LayoutManager
.
A LayoutManager must be provided for RecyclerView to function."

Marina

On Fri, Dec 2, 2016 at 2:06 PM, Chie Paliza  wrote:

> Im creating budgeting app. And I want to see the expenses of the user
> weekly but I have a problem, Im getting first the date and compare it in
> the dates in that week but no data
> shown in my recyclerview. This is my code:
>
> recyclerView.requestLayout();
> Log.e("myFirebaseData", "'" + month);
> adapter.cleanup();
>
>
> adapter = new FirebaseRecyclerAdapter(
> ExpenseData.class, R.layout.listitem, myViewHolder.class, 
> mRef.orderByChild("date")) {
>
>
> @Override
> protected void populateViewHolder(final myViewHolder viewHolder, 
> ExpenseData model, final int position) {
>
>
>java.util.Calendar c = Calendar.getInstance();
> DateFormat format = new SimpleDateFormat(" 
> dd, ", Locale.ENGLISH);
> c.setFirstDayOfWeek(Calendar.SUNDAY);
> c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
>
>
> String[] days = new String[7];
> for (int i = 0; i < 7; i++) {
> Log.e("dateTag", format.format(c.getTime()));
> days[i] = format.format(c.getTime());
> c.add(Calendar.DAY_OF_MONTH, 1);
>
> String checkDate = model.getDate();
> if (checkDate.contentEquals(days[i])) {
>
>
> 
> viewHolder.DateText.setText(model.getDate());
> 
> viewHolder.ExpenseTitleText.setText(model.getExpensetitle());
> 
> viewHolder.AmountText.setText(String.valueOf(String.format("%.2f", 
> model.getAmount(;
> }
> }
> }
>
> };
>
>
> recyclerView.setAdapter(adapter);
>
>
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/5c519fcd-837b-46d1-b0f2-
> 51b73fda5098%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CACaNmX1z%3DcKi575-eQyripmpMT_OyDVWRJFx9SF-v4x-23%3DV0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.