Skip to content

Commit

Permalink
sample data added
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ritik committed Aug 9, 2018
1 parent 9f0545b commit 5efe686
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 55 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'

implementation project(path: ':emojireactionlibrary')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void onBindViewHolder(@NonNull final ViewHolder holder, final int positio
final Feed feed = mDataSet.get(position);

holder.photo.setImageResource(feed.getPicAddress());
holder.photo.setHomeEmojiVisible();
holder.photo.setOnEmojiClickListener(new ClickInterface() {
@Override
public void onEmojiClicked(int emojiIndex, int x, int y) {
Expand Down
20 changes: 11 additions & 9 deletions app/src/main/java/com/ritik/emojireactionview/MyRecyclerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -32,19 +33,20 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
View view = inflater.inflate(R.layout.my_recycler, container, false);

RecyclerView mRecyclerView = view.findViewById(R.id.my_recycler_view);

// mRecyclerView.addItemDecoration(new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL));
feeds = new ArrayList<>();

mAdapter = new FeedAdapter(feeds);

feeds.add(new Feed("Rahul", R.drawable.android1_min, "Nov 6,11:52 AM", "howdy", -1));
feeds.add(new Feed("Ritik", R.drawable.android1_min, "Nov 6,11:52 AM", "fine", 1));
feeds.add(new Feed("Raj", R.drawable.android1_min, "Nov 6,11:52 AM", "Yup", 1));
feeds.add(new Feed("Rajendra", R.drawable.android1_min, "Nov 6,11:52 AM", "Enjoying", 1));
feeds.add(new Feed("Ravish", R.drawable.android1_min, "Nov 6,11:52 AM", "Life's Good", 1));
feeds.add(new Feed("Rajnath", R.drawable.android1_min, "Nov 6,11:52 AM", "Beautiful", 1));
feeds.add(new Feed("Ramesh", R.drawable.android1_min, "Nov 6,11:52 AM", "Great", 1));
feeds.add(new Feed("Rohit", R.drawable.android1_min, "Nov 6,11:52 AM", "Wooooow", 1));
feeds.add(new Feed("Adam", R.drawable.feed8, "Nov 6,11:52 AM", "The journey not the arrival matters.", -1));
feeds.add(new Feed("Alina", R.drawable.feed9, "Nov 6,11:52 AM", "Just living is not enough...", -1));
feeds.add(new Feed("Moore", R.drawable.feed3, "Nov 6,11:52 AM", "Quotes .... truth!! life", -1));
feeds.add(new Feed("James", R.drawable.feed4, "Nov 6,11:52 AM", "The dog is the perfect portrait subject. He doesn't pose. He isn't aware of the camera.", -1));
feeds.add(new Feed("Thomson", R.drawable.feed5, "Nov 6,11:52 AM", "I spent 90 percent of my money on women and drink. The rest I wasted!", -1));
feeds.add(new Feed("William", R.drawable.feed6, "Nov 6,11:52 AM", "Music is my medicine!!", -1));
feeds.add(new Feed("Olivia", R.drawable.feed7, "Nov 6,11:52 AM", "It's refreshing to have some time off from wondering whether I look fat.", -1));
feeds.add(new Feed("Emily", R.drawable.feed10, "Nov 6,11:52 AM", "Dream as if you’ll live forever, live as if you’ll die today.", -1));
feeds.add(new Feed("Sophia", R.drawable.feed1, "Nov 6,11:52 AM", "Adventure may hurt you but monotony will kill you.", -1));
mRecyclerView.setAdapter(mAdapter);

mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
Expand Down
Binary file removed app/src/main/res/drawable/android1_min.jpg
Binary file not shown.
Binary file added app/src/main/res/drawable/feed1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed7.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/feed9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 59 additions & 45 deletions app/src/main/res/layout/feed.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/messageLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:orientation="vertical"
android:padding="8dp">
android:layout_height="wrap_content">

<com.ritik.emojireactionlibrary.EmojiReactionView
android:id="@+id/photoImageView"
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
app:emojis="@array/emoji" />
android:layout_gravity="center"
android:layout_margin="5dp"
android:elevation="5dp"
android:padding="102dp"
card_view:cardCornerRadius="3dp">

<TextView
android:id="@+id/messageTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colorPrimaryDark"
android:textSize="25sp"
tools:text="Message" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:paddingBottom="3dp">

<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="35sp"
android:layout_alignParentEnd="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/background_others"
android:textSize="13sp"
tools:text="Nov 6, 11:28 PM" />

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:textSize="15sp"
android:textStyle="bold"
tools:text="88" />
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="5dp">

<TextView
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:textAlignment="textStart"
android:textColor="@color/colorPrimaryDark"
android:textSize="17sp"
android:textStyle="bold"
tools:text="my_name" />

<TextView
android:id="@+id/time"
android:layout_width="0dp"
android:layout_height="35sp"
android:layout_weight="2"
android:textAlignment="textEnd"
android:textColor="@color/background_others"
android:textSize="15sp"
tools:text="Nov 6, 10:28 PM" />

</LinearLayout>

<com.ritik.emojireactionlibrary.EmojiReactionView
android:id="@+id/photoImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
app:emojis="@array/emoji" />

</RelativeLayout>
<TextView
android:id="@+id/messageTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/background_others"
android:textSize="16sp"
tools:text="Message" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/simple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
android:scaleType="centerCrop"
android:src="@drawable/android1_min"
android:src="@drawable/feed11"
app:emojis="@array/emoji" />

</LinearLayout>

0 comments on commit 5efe686

Please sign in to comment.