From 28ada5747b2205713d448cfe3bd03be97bdd4f9e Mon Sep 17 00:00:00 2001 From: repineda <44100673+repineda@users.noreply.github.com> Date: Sat, 25 May 2019 23:39:50 -0700 Subject: [PATCH] viewing images leads to a black screen, https://github.com/stfalcon-studio/FrescoImageViewer/issues/94 this is having the same issue --- .idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes .idea/caches/gradle_models.ser | Bin 224473 -> 242150 bytes app/build.gradle | 7 +++- app/src/main/AndroidManifest.xml | 3 +- .../example/schat/Chat/MessageAdapter.java | 24 ++++++++++- .../com/example/schat/Chat/MessageObject.java | 7 +++- .../java/com/example/schat/ChatActivity.java | 11 ++++- .../com/example/schat/MainFeedActivity.java | 2 + app/src/main/res/layout/item_media.xml | 3 +- app/src/main/res/layout/item_message.xml | 39 +++++++++++------- build.gradle | 1 + 11 files changed, 74 insertions(+), 23 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 8167716d0bc53f0752103b5acef4bb88d63cb077..c7f19df6b4c2405d68a1144d6ddf4fbdd6bc1ad7 100644 GIT binary patch delta 55 zcmV-70LcHD1epYonFGykc#)iU5XLOsTir;=l$riPUWNk-+>;{#MG%TVnA&*JEUpc+ Nu!M)6qI{Eh0inEL8EgOm delta 55 zcmV-70LcHD1epYonFB^i0g;?{5Y-IkmWK50xeiZ3+-?27B$FcnMG%!v^STgvXFK(L N%E`p^HE@%70imfr8N>hp diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser index 0ff9bbb39f9bc679841a630d5cfa851d30f168f9..d4e308b7f85943b5c1d6ba96a39fe5693129f411 100644 GIT binary patch delta 18231 zcmd^HX?PUH)=qa1OL}^m1Ofy^vWQ_#n0*O^1PB;b2_gmv%d8NHWJM5sfPjjkVqlOG zY;8#EJoc6KalIn4VfKtZ_lI}h{k+^Hrg`;}${5k& zSzj?|h+;U~aP#%`I}3Lk46px~_cZ#bNJ?BE@oo?d@1R+E>r4F26YAYnQ6A$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Mofc^kOlQTJvgv;>&@O5&fYyjAfN_hY)0M-L+2XFxt0zkPdodx&} z0KV0(bQhou0E+4G27u3+9JK&m;~<)<>IdV;CXHs-*U6Q=938l&yrn9ym&ZuFrFJap zyym~u{QpNwz4L$8QpPcl#4e%+I>-xd^v?fiofM1bu(5HY#|=wLT2Qy7{O1pGo8)0u zRsW^SAl8%rV8UX}%RcJoyk%|08V;9L7PLif8Kz&3w0r&?jODwHt)pM + android:theme="@style/AppTheme" + android:usesCleartextTraffic="true"> diff --git a/app/src/main/java/com/example/schat/Chat/MessageAdapter.java b/app/src/main/java/com/example/schat/Chat/MessageAdapter.java index d7bde87..3ea100a 100644 --- a/app/src/main/java/com/example/schat/Chat/MessageAdapter.java +++ b/app/src/main/java/com/example/schat/Chat/MessageAdapter.java @@ -5,11 +5,14 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import com.example.schat.R; import com.google.firebase.database.FirebaseDatabase; +import com.stfalcon.frescoimageviewer.ImageViewer; + import java.util.ArrayList; public class MessageAdapter extends RecyclerView.Adapter @@ -30,10 +33,24 @@ public MessageViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewT return rcv; } @Override - public void onBindViewHolder(@NonNull MessageViewHolder holder, final int position) + public void onBindViewHolder(@NonNull final MessageViewHolder holder, final int position) { holder.message.setText(messageList.get(position).getMessage()); holder.sender.setText(messageList.get(position).getSenderId()); + + if(messageList.get(holder.getAdapterPosition()).getMediaUrLList().isEmpty()) + { + holder.viewMedia.setVisibility(View.GONE); + } + + holder.viewMedia.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + new ImageViewer.Builder(v.getContext(), messageList.get(holder.getAdapterPosition()).getMediaUrLList()) + .setStartPosition(0) + .show(); + } + }); } @Override @@ -42,13 +59,16 @@ public void onBindViewHolder(@NonNull MessageViewHolder holder, final int positi class MessageViewHolder extends RecyclerView.ViewHolder { TextView message, sender; + Button viewMedia; LinearLayout layout; MessageViewHolder(View view) { super(view); layout = view.findViewById(R.id.sendLayout); message = view.findViewById(R.id.message); - sender = view.findViewById(R.id.send); + sender = view.findViewById(R.id.sender); + + viewMedia = view.findViewById(R.id.viewMedia); } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/schat/Chat/MessageObject.java b/app/src/main/java/com/example/schat/Chat/MessageObject.java index 1d899fd..01113b7 100644 --- a/app/src/main/java/com/example/schat/Chat/MessageObject.java +++ b/app/src/main/java/com/example/schat/Chat/MessageObject.java @@ -1,17 +1,22 @@ package com.example.schat.Chat; +import java.util.ArrayList; + public class MessageObject { String messageId, senderId, message; + ArrayList mediaUrLList; - public MessageObject(String messageId, String senderId, String message) + public MessageObject(String messageId, String senderId, String message, ArrayList mediaUrLList) { this.messageId = messageId; this.senderId = senderId; this.message = message; + this.mediaUrLList = mediaUrLList; } public String getMessageId() { return messageId; } public String getSenderId() { return senderId; } public String getMessage() { return message; } + public ArrayList getMediaUrLList() { return mediaUrLList; } } \ No newline at end of file diff --git a/app/src/main/java/com/example/schat/ChatActivity.java b/app/src/main/java/com/example/schat/ChatActivity.java index 59d3024..29538b3 100644 --- a/app/src/main/java/com/example/schat/ChatActivity.java +++ b/app/src/main/java/com/example/schat/ChatActivity.java @@ -84,12 +84,21 @@ public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) if(dataSnapshot.exists()) { String text = "", creatorID = ""; + + ArrayList mediaUrlList = new ArrayList<>(); if(dataSnapshot.child("text").getValue() != null) text = dataSnapshot.child("text").getValue().toString(); if(dataSnapshot.child("creator").getValue() != null) creatorID = dataSnapshot.child("creator").getValue().toString(); + if(dataSnapshot.child("media").getChildrenCount() > 0) + { + for(DataSnapshot mediaSnapShot : dataSnapshot.child("media").getChildren()) + { + mediaUrlList.add(mediaSnapShot.getValue().toString()); + } + } - MessageObject mMessage = new MessageObject(dataSnapshot.getKey(), creatorID, text); + MessageObject mMessage = new MessageObject(dataSnapshot.getKey(), creatorID, text, mediaUrlList); messageList.add(mMessage); messageListLayoutManager.scrollToPosition(messageList.size()-1);//scrolls down to latest message messageAdapter.notifyDataSetChanged(); diff --git a/app/src/main/java/com/example/schat/MainFeedActivity.java b/app/src/main/java/com/example/schat/MainFeedActivity.java index e3775a4..b842be4 100644 --- a/app/src/main/java/com/example/schat/MainFeedActivity.java +++ b/app/src/main/java/com/example/schat/MainFeedActivity.java @@ -15,6 +15,7 @@ import com.example.schat.Chat.ChatObject; import com.example.schat.User.FindUserActivity; import com.example.schat.Chat.ChatListAdapter; +import com.facebook.drawee.backends.pipeline.Fresco; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; @@ -36,6 +37,7 @@ public class MainFeedActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_feed); + Fresco.initialize(this); // contact search Button mFindUser = findViewById(R.id.find_user); diff --git a/app/src/main/res/layout/item_media.xml b/app/src/main/res/layout/item_media.xml index 47eb9f8..c225d34 100644 --- a/app/src/main/res/layout/item_media.xml +++ b/app/src/main/res/layout/item_media.xml @@ -1,5 +1,6 @@ @@ -7,6 +8,6 @@ android:layout_width="wrap_content" android:layout_height="100sp" android:id="@+id/media" - android:src="@mipmap/ic_launcher"/> + app:srcCompat="@mipmap/ic_launcher"/> \ No newline at end of file diff --git a/app/src/main/res/layout/item_message.xml b/app/src/main/res/layout/item_message.xml index e6465ce..90a6281 100644 --- a/app/src/main/res/layout/item_message.xml +++ b/app/src/main/res/layout/item_message.xml @@ -1,27 +1,34 @@ + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:orientation="vertical"> - + android:id="@+id/message"/> -