Skip to content

Commit

Permalink
Date fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshakhtar209 committed Jul 8, 2019
1 parent 40883e5 commit ed919f0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import org.cfp.citizenconnect.Model.Notifications;
import org.cfp.citizenconnect.R;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class FullNotificationLayoutAdapter extends RecyclerView.Adapter<FullNotificationLayoutAdapter.MyViewHolder> {
Expand Down Expand Up @@ -59,7 +63,7 @@ public void onBindViewHolder(MyViewHolder holder, int position) {
holder.description.setText(notificationList.get(position).getDescription());
holder.DateTime.setText(notificationList.get(position).getDate());

// holder.BtnShare.setOnClickListener(view -> mListener.ShareImageClickListener(position, holder.snapHolder.getDrawable()));
// holder.BtnShare.setOnClickListener(view -> mListener.ShareImageClick`Listener(position, holder.snapHolder.getDrawable()));
// holder.view.setOnClickListener(view -> mListener.FullSizeImageClickListener(position,notificationList.get(position).getFilePath(), holder.description.getText().toString()));
/* holder.view.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -69,7 +73,6 @@ public void onClick(View view) {
});*/
holder.descriptionLayout.setOnClickListener(view -> mListener.FullSizeImageClickListener(position, notificationList.get(position).getFilePath(), holder.description.getText().toString()));
holder.snapHolder.setOnClickListener(view -> mListener.FullSizeImageClickListener(position, notificationList.get(position).getFilePath(), holder.description.getText().toString()));

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.facebook.drawee.view.SimpleDraweeView;

Expand All @@ -25,9 +30,8 @@ public class NotificationLayoutAdapter extends RecyclerView.Adapter<Notification
private final int VIEW_PROG = 0;

public NotificationLayoutAdapter(Context mContext, List<Notifications> snapList, OnItemInteractionListener mListener) {
this.notificationList = snapList;
this.mContext = mContext;
//inflater = LayoutInflater.from(mContext);
this.notificationList = snapList;
NotificationLayoutAdapter.mListener = mListener;
}

Expand Down
11 changes: 0 additions & 11 deletions app/src/main/java/org/cfp/citizenconnect/DashboardFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,4 @@ public void FullSizeImageClickListener(int position, String imagePath, String de

}

/* @Override
public void onResume() {
super.onResume();
((MainActivity)getActivity()).getSupportActionBar().hide();
}
@Override
public void onStop() {
super.onStop();
((MainActivity)getActivity()).getSupportActionBar().show();
}*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private void loadFromFirebase() {

public void OnSearchNotification(String query) {
notificationsModel.clear();
RealmResults<Notifications> realmResults = realm.where(Notifications.class).contains("description", query, Case.INSENSITIVE).findAll();
RealmResults<Notifications> realmResults = realm.where(Notifications.class).contains("description", query, Case.INSENSITIVE).findAll(); //&& realm.where(Notifications.class).contains("tag", query, Case.INSENSITIVE).findAll();
for (Notifications _Notifications : realmResults) {
notificationsModel.add(_Notifications);
}
Expand All @@ -216,7 +216,7 @@ public void OnSearchNotification(String query) {
}

public void updateRecyclerView() {
binding.swipeRefreshLayout.setRefreshing(false);
binding.swipeRefreshLayout.setRefreshing(true);
LinearLayoutManager fullnotificationList = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
fullnotificationListAdapter = new FullNotificationLayoutAdapter(this, notificationsModel,this);
binding.notificationList.setLayoutManager(fullnotificationList);
Expand Down

0 comments on commit ed919f0

Please sign in to comment.