From fb730784120a87970717923a8f03404a98ee065f Mon Sep 17 00:00:00 2001 From: samarth Date: Tue, 10 Mar 2020 19:57:16 +0530 Subject: [PATCH 1/2] beta Friendship feature applied --- build.gradle | 3 + src/main/AndroidManifest.xml | 28 +-- .../java/org/amahi/anywhere/AmahiModule.java | 8 +- .../anywhere/activity/FriendsActivity.java | 195 ++++++++++++++++++ .../anywhere/activity/NavigationActivity.java | 96 +++++++++ .../adapter/FriendRequestsAdapter.java | 73 +++++++ .../anywhere/adapter/FriendsPagerAdapter.java | 36 ++++ .../adapter/FriendsRecyclerViewAdapter.java | 68 ++++++ .../bus/FriendRequestsLoadFailedEvent.java | 5 + .../bus/FriendRequestsLoadedEvent.java | 18 ++ .../bus/FriendUsersLoadFailedEvent.java | 4 + .../anywhere/bus/FriendUsersLoadedEvent.java | 21 ++ .../anywhere/bus/FriendsSelectedEvent.java | 4 + .../fragment/FriendRequestsFragment.java | 119 +++++++++++ .../anywhere/fragment/FriendsFragment.java | 123 +++++++++++ .../anywhere/fragment/NavigationFragment.java | 15 ++ .../amahi/anywhere/server/api/ServerApi.java | 13 ++ .../anywhere/server/client/ServerClient.java | 5 + .../server/model/FriendRequestItem.java | 143 +++++++++++++ .../server/model/FriendRequestResponse.java | 39 ++++ .../anywhere/server/model/FriendUserItem.java | 86 ++++++++ .../server/model/FriendUserResponse.java | 39 ++++ .../org/amahi/anywhere/util/Fragments.java | 1 + .../java/org/amahi/anywhere/util/Intents.java | 14 ++ src/main/res/drawable-hdpi/ic_add_friend.xml | 5 + src/main/res/drawable-hdpi/ic_friends.xml | 10 + .../friend_status_background.xml | 6 + src/main/res/drawable-notnight/ic_friends.xml | 9 + src/main/res/layout/activity_friends.xml | 25 +++ .../res/layout/fragment_friend_requests.xml | 24 +++ src/main/res/layout/fragment_friends.xml | 25 +++ src/main/res/layout/fragment_navigation.xml | 23 +++ .../res/layout/friend_requests_list_item.xml | 52 +++++ src/main/res/layout/friends_list_item.xml | 48 +++++ src/main/res/values-v21/themes.xml | 14 ++ src/main/res/values/colors.xml | 6 + src/main/res/values/strings.xml | 2 +- src/main/res/values/themes.xml | 14 +- 38 files changed, 1395 insertions(+), 24 deletions(-) create mode 100644 src/main/java/org/amahi/anywhere/activity/FriendsActivity.java create mode 100644 src/main/java/org/amahi/anywhere/adapter/FriendRequestsAdapter.java create mode 100644 src/main/java/org/amahi/anywhere/adapter/FriendsPagerAdapter.java create mode 100644 src/main/java/org/amahi/anywhere/adapter/FriendsRecyclerViewAdapter.java create mode 100644 src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadFailedEvent.java create mode 100644 src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadedEvent.java create mode 100644 src/main/java/org/amahi/anywhere/bus/FriendUsersLoadFailedEvent.java create mode 100644 src/main/java/org/amahi/anywhere/bus/FriendUsersLoadedEvent.java create mode 100644 src/main/java/org/amahi/anywhere/bus/FriendsSelectedEvent.java create mode 100644 src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java create mode 100644 src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java create mode 100644 src/main/java/org/amahi/anywhere/server/model/FriendRequestItem.java create mode 100644 src/main/java/org/amahi/anywhere/server/model/FriendRequestResponse.java create mode 100644 src/main/java/org/amahi/anywhere/server/model/FriendUserItem.java create mode 100644 src/main/java/org/amahi/anywhere/server/model/FriendUserResponse.java create mode 100644 src/main/res/drawable-hdpi/ic_add_friend.xml create mode 100644 src/main/res/drawable-hdpi/ic_friends.xml create mode 100644 src/main/res/drawable-notnight/friend_status_background.xml create mode 100644 src/main/res/drawable-notnight/ic_friends.xml create mode 100644 src/main/res/layout/activity_friends.xml create mode 100644 src/main/res/layout/fragment_friend_requests.xml create mode 100644 src/main/res/layout/fragment_friends.xml create mode 100644 src/main/res/layout/friend_requests_list_item.xml create mode 100644 src/main/res/layout/friends_list_item.xml diff --git a/build.gradle b/build.gradle index 8a17b8158..60e78f7cb 100644 --- a/build.gradle +++ b/build.gradle @@ -110,6 +110,8 @@ static def formatStringField(field) { } dependencies { + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' repositories { google() mavenCentral() @@ -170,6 +172,7 @@ dependencies { implementation 'android.arch.persistence.room:runtime:' + rootProject.archRoomVersion annotationProcessor 'android.arch.persistence.room:compiler:' + rootProject.archRoomVersion + implementation 'com.balysv:material-ripple:1.0.2' // ripple effect // Uncomment the dependencies below to enable Chuck Interceptor for logging /* debugImplementation 'com.readystatesoftware.chuck:library:1.1.0' diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index f1feac084..509b8c993 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,23 +1,6 @@ - + @@ -32,7 +15,7 @@ - + @@ -56,6 +39,9 @@ android:theme="@style/Theme.Amahi" android:usesCleartextTraffic="true" tools:ignore="GoogleAppIndexingWarning"> + + - + diff --git a/src/main/java/org/amahi/anywhere/AmahiModule.java b/src/main/java/org/amahi/anywhere/AmahiModule.java index 7dbf6598a..d1f860f77 100644 --- a/src/main/java/org/amahi/anywhere/AmahiModule.java +++ b/src/main/java/org/amahi/anywhere/AmahiModule.java @@ -23,6 +23,7 @@ import android.content.Context; import org.amahi.anywhere.activity.AuthenticationActivity; +import org.amahi.anywhere.activity.FriendsActivity; import org.amahi.anywhere.activity.NativeVideoActivity; import org.amahi.anywhere.activity.NavigationActivity; import org.amahi.anywhere.activity.OfflineFilesActivity; @@ -35,6 +36,8 @@ import org.amahi.anywhere.activity.ServerFilesActivity; import org.amahi.anywhere.cache.CacheModule; import org.amahi.anywhere.fragment.AudioListFragment; +import org.amahi.anywhere.fragment.FriendRequestsFragment; +import org.amahi.anywhere.fragment.FriendsFragment; import org.amahi.anywhere.fragment.NavigationFragment; import org.amahi.anywhere.fragment.ServerAppsFragment; import org.amahi.anywhere.fragment.ServerFileAudioFragment; @@ -76,6 +79,7 @@ injects = { AuthenticationActivity.class, NavigationActivity.class, + FriendsActivity.class, ServerAppActivity.class, OfflineFilesActivity.class, ServerFilesActivity.class, @@ -107,7 +111,9 @@ TvPlaybackVideoActivity.class, TvPlaybackAudioActivity.class, TvPlaybackAudioFragment.class, - AudioMetadataRetrievingTask.class + AudioMetadataRetrievingTask.class, + FriendsFragment.class, + FriendRequestsFragment.class } ) class AmahiModule { diff --git a/src/main/java/org/amahi/anywhere/activity/FriendsActivity.java b/src/main/java/org/amahi/anywhere/activity/FriendsActivity.java new file mode 100644 index 000000000..3d5adfcd8 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/activity/FriendsActivity.java @@ -0,0 +1,195 @@ +package org.amahi.anywhere.activity; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.viewpager.widget.ViewPager; + +import android.os.Bundle; +import android.view.MenuItem; +import android.widget.Toast; + +import com.google.android.material.tabs.TabLayout; + +import org.amahi.anywhere.AmahiApplication; +import org.amahi.anywhere.R; +import org.amahi.anywhere.adapter.FriendsPagerAdapter; +import org.amahi.anywhere.bus.BusProvider; +import org.amahi.anywhere.bus.FriendRequestsLoadedEvent; +import org.amahi.anywhere.bus.FriendUsersLoadedEvent; +import org.amahi.anywhere.fragment.FriendRequestsFragment; +import org.amahi.anywhere.fragment.FriendsFragment; +import org.amahi.anywhere.server.api.ServerApi; +import org.amahi.anywhere.server.client.ServerClient; +import org.amahi.anywhere.server.model.FriendRequestResponse; +import org.amahi.anywhere.server.model.FriendUserResponse; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.gson.GsonConverterFactory; + +public class FriendsActivity extends AppCompatActivity { + + + @Inject + ServerClient serverClient; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_friends); + + setUpHomeNavigation(); + + setUpInjections(); + + setUpPager(); + + getTabLayout().setupWithViewPager(getPager()); + + loadData(); + } + + private void loadData() { + + Retrofit friendUsers = new Retrofit.Builder() + .baseUrl("https://friending-testing.herokuapp.com/") + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + ServerApi frndUserserverApi = friendUsers.create(ServerApi.class); + + Call frndUsercall = frndUserserverApi.getFriendUsers("abcdef"); + + + frndUsercall.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if(!response.isSuccessful()){ + Toast.makeText(FriendsActivity.this, "fail", Toast.LENGTH_SHORT).show(); + return; + } + FriendUserResponse friendUserResponse = response.body(); + BusProvider.getBus().post(new FriendUsersLoadedEvent(friendUserResponse.getFriendUsers())); + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + + + + Retrofit friendRequests = new Retrofit.Builder() + .baseUrl("https://friending-testing.herokuapp.com/") + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + ServerApi frndRequestServerapi = friendRequests.create(ServerApi.class); + + Call frndRequestcall = frndRequestServerapi.getFriendRequests("abcdef"); + + + frndRequestcall.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if(!response.isSuccessful()){ + Toast.makeText(FriendsActivity.this, "fail", Toast.LENGTH_SHORT).show(); + return; + } + + FriendRequestResponse friendRequestResponse = response.body(); + BusProvider.getBus().post(new FriendRequestsLoadedEvent(friendRequestResponse.getFriendRequests())); + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + + } + + private void setUpInjections() { + AmahiApplication.from(this).inject(this); + } + + private void setUpHomeNavigation() { + getSupportActionBar().setTitle("Friends"); + getSupportActionBar().setHomeButtonEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + private void setUpPager() { + + List fragmentList = getFragments(); + + List fragmentTitles = getFragmentTitles(); + + FriendsPagerAdapter adapter = new FriendsPagerAdapter(getSupportFragmentManager(), fragmentList, fragmentTitles); + getPager().setAdapter(adapter); + } + + @Override + public boolean onOptionsItemSelected(MenuItem menuItem) { + switch (menuItem.getItemId()) { + case android.R.id.home: + onBackPressed(); + return true; + + default: + return super.onOptionsItemSelected(menuItem); + } + } + + private List getFragments() { + + Fragment friendsFragment = new FriendsFragment(); + Fragment friendRequestsFragment = new FriendRequestsFragment(); + List fragmentList = new ArrayList<>(); + fragmentList.add(friendsFragment); + fragmentList.add(friendRequestsFragment); + + return fragmentList; + } + + private List getFragmentTitles() { + + List fragmentTitles = new ArrayList<>(); + fragmentTitles.add("Friends"); + fragmentTitles.add("Friend Requests"); + + return fragmentTitles; + } + + private ViewPager getPager() { + return findViewById(R.id.pager_friends); + } + + private TabLayout getTabLayout() { + return findViewById(R.id.tablayout_friends); + } + + + @Override + public void onResume() { + super.onResume(); + + BusProvider.getBus().register(this); + } + + @Override + public void onPause() { + super.onPause(); + + BusProvider.getBus().unregister(this); + } + +} diff --git a/src/main/java/org/amahi/anywhere/activity/NavigationActivity.java b/src/main/java/org/amahi/anywhere/activity/NavigationActivity.java index 20b8d5c89..22edebec5 100644 --- a/src/main/java/org/amahi/anywhere/activity/NavigationActivity.java +++ b/src/main/java/org/amahi/anywhere/activity/NavigationActivity.java @@ -35,6 +35,7 @@ import android.view.ViewStub; import android.widget.FrameLayout; import android.widget.RelativeLayout; +import android.widget.Toast; import com.squareup.otto.Subscribe; @@ -43,12 +44,18 @@ import org.amahi.anywhere.bus.AppSelectedEvent; import org.amahi.anywhere.bus.AppsSelectedEvent; import org.amahi.anywhere.bus.BusProvider; +import org.amahi.anywhere.bus.FriendRequestsLoadedEvent; +import org.amahi.anywhere.bus.FriendUsersLoadedEvent; +import org.amahi.anywhere.bus.FriendsSelectedEvent; import org.amahi.anywhere.bus.OfflineFilesSelectedEvent; import org.amahi.anywhere.bus.RecentFilesSelectedEvent; import org.amahi.anywhere.bus.SettingsSelectedEvent; import org.amahi.anywhere.bus.ShareSelectedEvent; import org.amahi.anywhere.bus.SharesSelectedEvent; +import org.amahi.anywhere.server.api.ServerApi; import org.amahi.anywhere.server.client.ServerClient; +import org.amahi.anywhere.server.model.FriendRequestResponse; +import org.amahi.anywhere.server.model.FriendUserResponse; import org.amahi.anywhere.server.model.ServerApp; import org.amahi.anywhere.server.model.ServerShare; import org.amahi.anywhere.tv.activity.IntroActivity; @@ -60,6 +67,12 @@ import javax.inject.Inject; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.gson.GsonConverterFactory; + /** * Navigation activity. This is an entry point of the application. Shows navigation between * main application sections (shares, apps) and shares and apps lists itself. On phones the activity @@ -95,6 +108,7 @@ protected void onCreate(Bundle savedInstanceState) { setUpHomeNavigation(); setUpNavigation(savedInstanceState); + } private void handleTvFirstRun() { @@ -345,6 +359,24 @@ private void showRecentFiles() { startActivity(intent); } + + @Subscribe + public void onFriendsSelected(FriendsSelectedEvent event) { + + showFriends(); + if (isNavigationDrawerAvailable()) { + hideNavigationDrawer(); + } + + } + + private void showFriends() { + Intent intent = Intents.Builder.with(this).buildFriendsActivity(); + startActivity(intent); + } + + + @Subscribe public void onShareSelected(ShareSelectedEvent event) { setUpShare(event.getShare()); @@ -451,4 +483,68 @@ private static final class State { private State() { } } + + + private void loadData() { + + Retrofit friendUsers = new Retrofit.Builder() + .baseUrl("https://friending-testing.herokuapp.com/") + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + ServerApi frndUserserverApi = friendUsers.create(ServerApi.class); + + Call frndUsercall = frndUserserverApi.getFriendUsers("abcdef"); + + + frndUsercall.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if(!response.isSuccessful()){ + Toast.makeText(NavigationActivity.this, "fail", Toast.LENGTH_SHORT).show(); + return; + } + FriendUserResponse friendUserResponse = response.body(); + BusProvider.getBus().post(new FriendUsersLoadedEvent(friendUserResponse.getFriendUsers())); + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + + + + Retrofit friendRequests = new Retrofit.Builder() + .baseUrl("https://friending-testing.herokuapp.com/") + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + ServerApi frndRequestServerapi = friendRequests.create(ServerApi.class); + + Call frndRequestcall = frndRequestServerapi.getFriendRequests("abcdef"); + + + frndRequestcall.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if(!response.isSuccessful()){ + Toast.makeText(NavigationActivity.this, "fail", Toast.LENGTH_SHORT).show(); + return; + } + + FriendRequestResponse friendRequestResponse = response.body(); + BusProvider.getBus().post(new FriendRequestsLoadedEvent(friendRequestResponse.getFriendRequests())); + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + + } + + } diff --git a/src/main/java/org/amahi/anywhere/adapter/FriendRequestsAdapter.java b/src/main/java/org/amahi/anywhere/adapter/FriendRequestsAdapter.java new file mode 100644 index 000000000..bb49a8326 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/adapter/FriendRequestsAdapter.java @@ -0,0 +1,73 @@ +package org.amahi.anywhere.adapter; + +import android.content.Context; +import android.content.DialogInterface; +import android.os.Build; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + + +import org.amahi.anywhere.R; +import org.amahi.anywhere.server.model.FriendRequestItem; + +import java.util.List; + +public class FriendRequestsAdapter extends RecyclerView.Adapter { + private List friendRequestsList; + private Context context; + + public FriendRequestsAdapter(Context context, List friendRequestsList) { + this.context = context; + this.friendRequestsList = friendRequestsList; + + } + + + @NonNull + @Override + public FriendRequestsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.friend_requests_list_item, parent, false); + FriendRequestsViewHolder friendRequestsViewHolder = new FriendRequestsViewHolder(view); + + return friendRequestsViewHolder; + } + + @Override + public void onBindViewHolder(@NonNull FriendRequestsViewHolder holder, int position) { + holder.friendEmailText.setText(friendRequestsList.get(position).getEmail()); + String status = friendRequestsList.get(position).getStatusTxt(); + + holder.friendRequestStatus.setText(status); + + } + + @Override + public int getItemCount() { + return friendRequestsList.size(); + } + + class FriendRequestsViewHolder extends RecyclerView.ViewHolder { + TextView friendEmailText; + TextView friendRequestStatus; + LinearLayout friendsRequestLinearLayout; + FriendRequestsViewHolder(View itemView) { + super(itemView); + friendsRequestLinearLayout = itemView.findViewById(R.id.friends_request_linear_layout); + friendEmailText = itemView.findViewById(R.id.text_friend_request_email); + friendRequestStatus = itemView.findViewById(R.id.text_friend_request_status); + } + } + + +} + + + diff --git a/src/main/java/org/amahi/anywhere/adapter/FriendsPagerAdapter.java b/src/main/java/org/amahi/anywhere/adapter/FriendsPagerAdapter.java new file mode 100644 index 000000000..fea1093e6 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/adapter/FriendsPagerAdapter.java @@ -0,0 +1,36 @@ +package org.amahi.anywhere.adapter; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; + +import java.util.List; + +public class FriendsPagerAdapter extends FragmentStatePagerAdapter { + private List fragmentList; + private List fragmentTitles; + + public FriendsPagerAdapter(FragmentManager fm, List fragmentList, + List fragmentTitles) { + super(fm); + this.fragmentList = fragmentList; + this.fragmentTitles = fragmentTitles; + } + + @Nullable + @Override + public CharSequence getPageTitle(int position) { + return fragmentTitles.get(position); + } + + @Override + public Fragment getItem(int position) { + return fragmentList.get(position); + } + + @Override + public int getCount() { + return fragmentList.size(); + } +} diff --git a/src/main/java/org/amahi/anywhere/adapter/FriendsRecyclerViewAdapter.java b/src/main/java/org/amahi/anywhere/adapter/FriendsRecyclerViewAdapter.java new file mode 100644 index 000000000..3f0dffe66 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/adapter/FriendsRecyclerViewAdapter.java @@ -0,0 +1,68 @@ +package org.amahi.anywhere.adapter; + +import android.content.Context; +import android.content.DialogInterface; +import android.os.Build; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.material.bottomsheet.BottomSheetBehavior; +import com.google.android.material.bottomsheet.BottomSheetDialog; + +import org.amahi.anywhere.R; +import org.amahi.anywhere.server.model.FriendUserItem; + +import java.util.List; + +public class FriendsRecyclerViewAdapter extends RecyclerView.Adapter { + private List friendsList; + private Context context; + + public FriendsRecyclerViewAdapter(Context context, List friendsList) { + this.context = context; + this.friendsList = friendsList; + + } + + @NonNull + @Override + public FriendsListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new FriendsListViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.friends_list_item, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull FriendsListViewHolder holder, int position) { + holder.friendEmailText.setText(friendsList.get(position).getEmail()); + StringBuilder builder = new StringBuilder(); + builder.append("Friends since "); + builder.append(friendsList.get(position).getCreatedAt()); + holder.createdAt.setText(builder); + } + + @Override + public int getItemCount() { + return friendsList.size(); + } + + class FriendsListViewHolder extends RecyclerView.ViewHolder { + TextView friendEmailText; + TextView createdAt; + + FriendsListViewHolder(View itemView) { + super(itemView); + friendEmailText = itemView.findViewById(R.id.text_friend_email); + createdAt = itemView.findViewById(R.id.text_friend_created_at); + + } + } + +} + + diff --git a/src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadFailedEvent.java b/src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadFailedEvent.java new file mode 100644 index 000000000..4a213935a --- /dev/null +++ b/src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadFailedEvent.java @@ -0,0 +1,5 @@ +package org.amahi.anywhere.bus; + + +public class FriendRequestsLoadFailedEvent implements BusEvent { +} diff --git a/src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadedEvent.java b/src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadedEvent.java new file mode 100644 index 000000000..2c585e7b5 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/bus/FriendRequestsLoadedEvent.java @@ -0,0 +1,18 @@ +package org.amahi.anywhere.bus; + + +import org.amahi.anywhere.server.model.FriendRequestItem; + +import java.util.List; + +public class FriendRequestsLoadedEvent implements BusEvent { + private final List friendRequests; + + public FriendRequestsLoadedEvent(List friendRequests) { + this.friendRequests = friendRequests; + } + + public List getFriendRequests() { + return friendRequests; + } +} diff --git a/src/main/java/org/amahi/anywhere/bus/FriendUsersLoadFailedEvent.java b/src/main/java/org/amahi/anywhere/bus/FriendUsersLoadFailedEvent.java new file mode 100644 index 000000000..003e6bf57 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/bus/FriendUsersLoadFailedEvent.java @@ -0,0 +1,4 @@ +package org.amahi.anywhere.bus; + +public class FriendUsersLoadFailedEvent implements BusEvent { +} diff --git a/src/main/java/org/amahi/anywhere/bus/FriendUsersLoadedEvent.java b/src/main/java/org/amahi/anywhere/bus/FriendUsersLoadedEvent.java new file mode 100644 index 000000000..69210e354 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/bus/FriendUsersLoadedEvent.java @@ -0,0 +1,21 @@ +package org.amahi.anywhere.bus; + +import android.util.Log; + +import org.amahi.anywhere.server.model.FriendUserItem; + +import java.util.List; + +public class FriendUsersLoadedEvent implements BusEvent { + private final List friendUsers; + + public FriendUsersLoadedEvent(List friendUsers) { + this.friendUsers = friendUsers; + + } + + public List getFriendUsers() { + Log.d("entered", "getLEFriendUsrs:"); + return friendUsers; + } +} diff --git a/src/main/java/org/amahi/anywhere/bus/FriendsSelectedEvent.java b/src/main/java/org/amahi/anywhere/bus/FriendsSelectedEvent.java new file mode 100644 index 000000000..d66e9ab09 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/bus/FriendsSelectedEvent.java @@ -0,0 +1,4 @@ +package org.amahi.anywhere.bus; + +public class FriendsSelectedEvent implements BusEvent { +} diff --git a/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java b/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java new file mode 100644 index 000000000..553951712 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java @@ -0,0 +1,119 @@ +package org.amahi.anywhere.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.facebook.shimmer.ShimmerFrameLayout; +import com.squareup.otto.Subscribe; + +import org.amahi.anywhere.AmahiApplication; +import org.amahi.anywhere.R; +import org.amahi.anywhere.adapter.FriendRequestsAdapter; +import org.amahi.anywhere.bus.BusProvider; +import org.amahi.anywhere.bus.FriendRequestsLoadedEvent; +import org.amahi.anywhere.server.client.ServerClient; +import org.amahi.anywhere.server.model.FriendRequestItem; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +/** + * Friend Requests Fragment, shows list of friend requests. + */ +public class FriendRequestsFragment extends Fragment { + + @Inject + ServerClient serverClient; + private List friendRequestsList = new ArrayList<>(); + + private ProgressBar progressBarRequests; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_friend_requests, container, false); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + setUpInjections(); + +// setUpFriendRequestsList(savedInstanceState); + getProgressBarUsersRequests(); + } + + private void setUpInjections() { + AmahiApplication.from(getActivity()).inject(this); + } + + private RecyclerView getRecyclerView() { + return getView().findViewById(R.id.list_friend_requests); + } + + private ProgressBar getProgressBarUsersRequests(){ + progressBarRequests = (ProgressBar) getView().findViewById(R.id.progress_bar_friendRequests); + return progressBarRequests; + } + + + private void setUpFriendRequestsList(Bundle state) { + if (serverClient.isConnected()) { + + } + setUpListAdapter(); + + + } + + private FriendRequestsAdapter getListAdapter() { + return (FriendRequestsAdapter) getRecyclerView().getAdapter(); + } + + private void setUpListAdapter() { + FriendRequestsAdapter adapter = new FriendRequestsAdapter(getContext(), friendRequestsList); + getRecyclerView().setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false)); + getRecyclerView().setAdapter(adapter); + progressBarRequests.setVisibility(View.GONE); + getRecyclerView().setVisibility(View.VISIBLE); + + } + + + + + @Override + public void onResume() { + super.onResume(); + + BusProvider.getBus().register(this); + } + + @Override + public void onPause() { + super.onPause(); + + BusProvider.getBus().unregister(this); + } + + + @Subscribe + public void onFriendRequestsLoaded(FriendRequestsLoadedEvent event) { + friendRequestsList = event.getFriendRequests(); + setUpListAdapter(); + } + +} diff --git a/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java b/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java new file mode 100644 index 000000000..d673c3e05 --- /dev/null +++ b/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java @@ -0,0 +1,123 @@ +package org.amahi.anywhere.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.facebook.shimmer.ShimmerFrameLayout; +import com.squareup.otto.Subscribe; + +import org.amahi.anywhere.AmahiApplication; +import org.amahi.anywhere.R; +import org.amahi.anywhere.adapter.FriendsRecyclerViewAdapter; +import org.amahi.anywhere.bus.BusProvider; +import org.amahi.anywhere.bus.FriendUsersLoadedEvent; +import org.amahi.anywhere.bus.ServerConnectionFailedEvent; +import org.amahi.anywhere.server.client.ServerClient; +import org.amahi.anywhere.server.model.FriendUserItem; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +/** + * Friends Fragment, shows list of friended users. + */ +public class FriendsFragment extends Fragment { + + @Inject + ServerClient serverclient; + + private List friendsList = new ArrayList<>(); + private ProgressBar progressBarUsers; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + + return inflater.inflate(R.layout.fragment_friends, container, false); + + } + + private void setUpInjections() { + AmahiApplication.from(getActivity()).inject(this); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + setUpInjections(); + +// setUpFriendsList(savedInstanceState); + getProgressBarUsers(); + + } + + @Subscribe + public void onFriendUsersLoaded(FriendUsersLoadedEvent event) { + friendsList = event.getFriendUsers(); + setUpListAdapter(); + } + + + private RecyclerView getRecyclerView() { + return (RecyclerView) getView().findViewById(R.id.list_friends); + } + + private ProgressBar getProgressBarUsers(){ + progressBarUsers = (ProgressBar) getView().findViewById(R.id.progress_bar_friendUsers); + return progressBarUsers; + } + + + private void setUpFriendsList(Bundle state) { + if (serverclient.isConnected()) { + + } + + setUpListAdapter(); + } + + + private FriendsRecyclerViewAdapter getListAdapter() { + return (FriendsRecyclerViewAdapter) getRecyclerView().getAdapter(); + } + + + private void setUpListAdapter() { + + FriendsRecyclerViewAdapter adapter = new FriendsRecyclerViewAdapter(getContext(), friendsList); + getRecyclerView().setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false)); + getRecyclerView().setAdapter(adapter); + progressBarUsers.setVisibility(View.GONE); + getRecyclerView().setVisibility(View.VISIBLE); + + } + + @Override + public void onResume() { + super.onResume(); + + BusProvider.getBus().register(this); + } + + @Override + public void onPause() { + super.onPause(); + + BusProvider.getBus().unregister(this); + } + + +} diff --git a/src/main/java/org/amahi/anywhere/fragment/NavigationFragment.java b/src/main/java/org/amahi/anywhere/fragment/NavigationFragment.java index d3d2fe9b9..89a26644b 100644 --- a/src/main/java/org/amahi/anywhere/fragment/NavigationFragment.java +++ b/src/main/java/org/amahi/anywhere/fragment/NavigationFragment.java @@ -54,6 +54,7 @@ import org.amahi.anywhere.adapter.NavigationDrawerAdapter; import org.amahi.anywhere.bus.AppsSelectedEvent; import org.amahi.anywhere.bus.BusProvider; +import org.amahi.anywhere.bus.FriendsSelectedEvent; import org.amahi.anywhere.bus.OfflineFilesSelectedEvent; import org.amahi.anywhere.bus.RecentFilesSelectedEvent; import org.amahi.anywhere.bus.ServerConnectedEvent; @@ -355,10 +356,15 @@ private void setUpNavigationList() { showServers(); hideOfflineLayout(); hideRecentLayout(); + } } + private void hideFriendsLayout() { + getFriendsLayout().setVisibility(View.GONE); + } + private void hideOfflineLayout() { getOfflineFilesLayout().setVisibility(View.GONE); } @@ -394,6 +400,9 @@ private LinearLayout getRecentFilesLayout() { return getView().findViewById(R.id.recent_files_layout); } + private LinearLayout getFriendsLayout() { + return getView().findViewById(R.id.friends_layout); + } private LinearLayout getLinearLayoutSelectedServer() { return getView().findViewById(R.id.server_select_LinearLayout); } @@ -418,6 +427,8 @@ private void setUpNavigationListener() { getOfflineFilesLayout().setOnClickListener(view -> showOfflineFiles()); getRecentFilesLayout().setOnClickListener(view -> showRecentFiles()); + + getFriendsLayout().setOnClickListener(view -> showFriends()); } private void selectedServerListener(int position) { @@ -613,6 +624,10 @@ private void showRecentFiles() { BusProvider.getBus().post(new RecentFilesSelectedEvent()); } + private void showFriends() { + BusProvider.getBus().post(new FriendsSelectedEvent()); + } + @Subscribe public void onServerConnectionChanged(ServerConnectionChangedEvent event) { areServersVisible = false; diff --git a/src/main/java/org/amahi/anywhere/server/api/ServerApi.java b/src/main/java/org/amahi/anywhere/server/api/ServerApi.java index 937c789f8..46c408f56 100644 --- a/src/main/java/org/amahi/anywhere/server/api/ServerApi.java +++ b/src/main/java/org/amahi/anywhere/server/api/ServerApi.java @@ -19,6 +19,8 @@ package org.amahi.anywhere.server.api; +import org.amahi.anywhere.server.model.FriendRequestResponse; +import org.amahi.anywhere.server.model.FriendUserResponse; import org.amahi.anywhere.server.model.ServerApp; import org.amahi.anywhere.server.model.ServerFile; import org.amahi.anywhere.server.model.ServerFileMetadata; @@ -74,4 +76,15 @@ Call getFileMetadata( @GET("/apps") Call> getApps( @Header("Session") String session); + + + @GET("/frnd/users") + Call getFriendUsers( + @Header("api-key") String apiKey); + + + @GET("/frnd/requests") + Call getFriendRequests( + @Header("api-key") String apiKey); + } diff --git a/src/main/java/org/amahi/anywhere/server/client/ServerClient.java b/src/main/java/org/amahi/anywhere/server/client/ServerClient.java index b5dd13282..d2ca69d28 100644 --- a/src/main/java/org/amahi/anywhere/server/client/ServerClient.java +++ b/src/main/java/org/amahi/anywhere/server/client/ServerClient.java @@ -70,6 +70,7 @@ import static org.amahi.anywhere.util.Android.loadServersFromAsset; + /** * Server API implementation. Wraps {@link org.amahi.anywhere.server.api.ProxyApi} and * {@link org.amahi.anywhere.server.api.ServerApi}. Reacts to network connection changes as well. @@ -86,6 +87,8 @@ public class ServerClient { private ApiConnection serverConnection; private int network; + private static final String BASE_URL = "https://friending-testing.herokuapp.com"; + private static final String apiKey = "abcdef"; @Inject public ServerClient(ApiAdapter apiAdapter) { @@ -327,4 +330,6 @@ public void getFileMetadata(ServerShare share, ServerFile file, Callback friendRequests; + + public void setSuccess(boolean success){ + this.success = success; + } + + public boolean isSuccess(){ + return success; + } + + public void setFriendRequests(List friendRequests){ + this.friendRequests = friendRequests; + } + + public List getFriendRequests(){ + return friendRequests; + } + + @Override + public String toString(){ + return + "FriendRequestResponse{" + + "success = '" + success + '\'' + + ",friend_request = '" + friendRequests + '\'' + + "}"; + } +} diff --git a/src/main/java/org/amahi/anywhere/server/model/FriendUserItem.java b/src/main/java/org/amahi/anywhere/server/model/FriendUserItem.java new file mode 100644 index 000000000..bbf2c246a --- /dev/null +++ b/src/main/java/org/amahi/anywhere/server/model/FriendUserItem.java @@ -0,0 +1,86 @@ +package org.amahi.anywhere.server.model; + +import com.google.gson.annotations.SerializedName; + +public class FriendUserItem{ + + @SerializedName("amahi_user_id") + private int amahiUserId; + + @SerializedName("updated_at") + private String updatedAt; + + @SerializedName("system_id") + private int systemId; + + @SerializedName("created_at") + private String createdAt; + + @SerializedName("id") + private int id; + + @SerializedName("email") + private String email; + + + public void setAmahiUserId(int amahiUserId){ + this.amahiUserId = amahiUserId; + } + + public int getAmahiUserId(){ + return amahiUserId; + } + + public void setUpdatedAt(String updatedAt){ + this.updatedAt = updatedAt; + } + + public String getUpdatedAt(){ + return updatedAt; + } + + public void setSystemId(int systemId){ + this.systemId = systemId; + } + + public int getSystemId(){ + return systemId; + } + + public void setCreatedAt(String createdAt){ + this.createdAt = createdAt; + } + + public String getCreatedAt(){ + return createdAt; + } + + public void setId(int id){ + this.id = id; + } + + public int getId(){ + return id; + } + + public void setEmail(String email){ + this.email = email; + } + + public String getEmail(){ + return email; + } + + @Override + public String toString(){ + return + "FriendUserItem{" + + "amahi_user_id = '" + amahiUserId + '\'' + + ",updated_at = '" + updatedAt + '\'' + + ",system_id = '" + systemId + '\'' + + ",created_at = '" + createdAt + '\'' + + ",id = '" + id + '\'' + + ",email = '" + email + '\'' + + "}"; + } +} diff --git a/src/main/java/org/amahi/anywhere/server/model/FriendUserResponse.java b/src/main/java/org/amahi/anywhere/server/model/FriendUserResponse.java new file mode 100644 index 000000000..7d3f53e4d --- /dev/null +++ b/src/main/java/org/amahi/anywhere/server/model/FriendUserResponse.java @@ -0,0 +1,39 @@ +package org.amahi.anywhere.server.model; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class FriendUserResponse{ + + @SerializedName("data") + private List friendUsers; + + @SerializedName("success") + private boolean success; + + public void setFriendUsers(List friendUsers){ + this.friendUsers = friendUsers; + } + + public List getFriendUsers(){ + return friendUsers; + } + + public void setSuccess(boolean success){ + this.success = success; + } + + public boolean isSuccess(){ + return success; + } + + @Override + public String toString(){ + return + "FriendUserResponse{" + + "friend_user = '" + friendUsers + '\'' + + ",success = '" + success + '\'' + + "}"; + } +} diff --git a/src/main/java/org/amahi/anywhere/util/Fragments.java b/src/main/java/org/amahi/anywhere/util/Fragments.java index 97d52d05e..aa2260eff 100644 --- a/src/main/java/org/amahi/anywhere/util/Fragments.java +++ b/src/main/java/org/amahi/anywhere/util/Fragments.java @@ -187,6 +187,7 @@ public static BottomSheetDialogFragment buildOfflineFileOptionsDialogFragment() return fragment; } + } public static final class Operator { diff --git a/src/main/java/org/amahi/anywhere/util/Intents.java b/src/main/java/org/amahi/anywhere/util/Intents.java index 92b45abaa..c4dacb525 100644 --- a/src/main/java/org/amahi/anywhere/util/Intents.java +++ b/src/main/java/org/amahi/anywhere/util/Intents.java @@ -30,6 +30,7 @@ import androidx.annotation.NonNull; import org.amahi.anywhere.R; +import org.amahi.anywhere.activity.FriendsActivity; import org.amahi.anywhere.activity.IntroductionActivity; import org.amahi.anywhere.activity.OfflineFilesActivity; import org.amahi.anywhere.activity.RecentFilesActivity; @@ -117,6 +118,10 @@ public Intent buildRecentFilesActivity() { return new Intent(context, RecentFilesActivity.class); } + public Intent buildFriendsActivity() { + return new Intent(context, FriendsActivity.class); + } + public Intent buildServerTvFilesActivity(ServerShare share, ServerFile file) { Intent intent = new Intent(context, ServerFileTvActivity.class); intent.putExtra(Extras.SERVER_FILE, file); @@ -187,6 +192,15 @@ public Intent buildRecentFileIntent(RecentFile file) { return intent; } + public Intent buildFriends(RecentFile file) { + Intent intent = new Intent(context, getServerFileActivity(file.getMime())); + intent.putExtra(Extras.UNIQUE_KEY, file.getUniqueKey()); + intent.putExtra(Extras.FILE_TYPE, FileManager.RECENT_FILE); + + return intent; + } + + public boolean isServerFileOpeningSupported(ServerFile file) { PackageManager packageManager = context.getPackageManager(); diff --git a/src/main/res/drawable-hdpi/ic_add_friend.xml b/src/main/res/drawable-hdpi/ic_add_friend.xml new file mode 100644 index 000000000..c273ca40b --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_add_friend.xml @@ -0,0 +1,5 @@ + + + diff --git a/src/main/res/drawable-hdpi/ic_friends.xml b/src/main/res/drawable-hdpi/ic_friends.xml new file mode 100644 index 000000000..e9c32676b --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_friends.xml @@ -0,0 +1,10 @@ + + + diff --git a/src/main/res/drawable-notnight/friend_status_background.xml b/src/main/res/drawable-notnight/friend_status_background.xml new file mode 100644 index 000000000..326cd2c68 --- /dev/null +++ b/src/main/res/drawable-notnight/friend_status_background.xml @@ -0,0 +1,6 @@ + + + + diff --git a/src/main/res/drawable-notnight/ic_friends.xml b/src/main/res/drawable-notnight/ic_friends.xml new file mode 100644 index 000000000..087a5904b --- /dev/null +++ b/src/main/res/drawable-notnight/ic_friends.xml @@ -0,0 +1,9 @@ + + + diff --git a/src/main/res/layout/activity_friends.xml b/src/main/res/layout/activity_friends.xml new file mode 100644 index 000000000..e2c2ae16c --- /dev/null +++ b/src/main/res/layout/activity_friends.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/src/main/res/layout/fragment_friend_requests.xml b/src/main/res/layout/fragment_friend_requests.xml new file mode 100644 index 000000000..8317cf6da --- /dev/null +++ b/src/main/res/layout/fragment_friend_requests.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/src/main/res/layout/fragment_friends.xml b/src/main/res/layout/fragment_friends.xml new file mode 100644 index 000000000..50cb37ccc --- /dev/null +++ b/src/main/res/layout/fragment_friends.xml @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/src/main/res/layout/fragment_navigation.xml b/src/main/res/layout/fragment_navigation.xml index edf107c4c..4ff025ea6 100644 --- a/src/main/res/layout/fragment_navigation.xml +++ b/src/main/res/layout/fragment_navigation.xml @@ -151,6 +151,29 @@ android:textStyle="bold" /> + + + + + + + diff --git a/src/main/res/layout/friend_requests_list_item.xml b/src/main/res/layout/friend_requests_list_item.xml new file mode 100644 index 000000000..afd807375 --- /dev/null +++ b/src/main/res/layout/friend_requests_list_item.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + diff --git a/src/main/res/layout/friends_list_item.xml b/src/main/res/layout/friends_list_item.xml new file mode 100644 index 000000000..c61e5eb7d --- /dev/null +++ b/src/main/res/layout/friends_list_item.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + diff --git a/src/main/res/values-v21/themes.xml b/src/main/res/values-v21/themes.xml index 68f84ae63..1935e42b7 100644 --- a/src/main/res/values-v21/themes.xml +++ b/src/main/res/values-v21/themes.xml @@ -37,6 +37,14 @@ 8dp + + + + + + diff --git a/src/main/res/values/colors.xml b/src/main/res/values/colors.xml index ebd234459..577dd01ed 100644 --- a/src/main/res/values/colors.xml +++ b/src/main/res/values/colors.xml @@ -46,4 +46,10 @@ #26a69a #ffab00 #303f9f + + + #19B4F4 + #4CBB17 + #E60000 + #fad201 diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 486a0b32a..5af3bb0df 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -29,6 +29,7 @@ Upload Offline Files Recent Files + friends Search Google Play Sign in @@ -190,5 +191,4 @@ Shows file download progress - diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 87bef4394..dedc4fc54 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -71,6 +71,18 @@ 8dp + + + + - + From 280c7b9bff1d6f294c2bfac7817408d10a0f4aa5 Mon Sep 17 00:00:00 2001 From: samarth Date: Tue, 10 Mar 2020 20:35:45 +0530 Subject: [PATCH 2/2] beta friendship feature added --- .../org/amahi/anywhere/fragment/FriendRequestsFragment.java | 2 +- src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java b/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java index 553951712..a0d6c6139 100644 --- a/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java +++ b/src/main/java/org/amahi/anywhere/fragment/FriendRequestsFragment.java @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.facebook.shimmer.ShimmerFrameLayout; + import com.squareup.otto.Subscribe; import org.amahi.anywhere.AmahiApplication; diff --git a/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java b/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java index d673c3e05..5cd4589d9 100644 --- a/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java +++ b/src/main/java/org/amahi/anywhere/fragment/FriendsFragment.java @@ -13,7 +13,6 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.facebook.shimmer.ShimmerFrameLayout; import com.squareup.otto.Subscribe; import org.amahi.anywhere.AmahiApplication;