My activitymain.xml file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include android:id="@+id/app_bar" layout="@layout/toolbar"/>
<view
android:id="@+id/recycler_view"
android:layout_below="@id/app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="android.support.v7.widget.RecyclerView"/>
</RelativeLayout>
Because my main.java file only contains Recyclerview and nothing else, i can't directly add 2 buttons into it.
I tried to add 2 imageButtons in the the recyclerView.
RecyclerView does not properly render itself in AndroidStudio - there is an issue from google.
So i can't see how exactly recycler view and toolbar(app_bar) stand to each other(I assume app_bar toolbar is below recyclerview(layout_below attribute) )
I suspect i should totally change the design of the app to finish it.
MainActivity.java, it only has recyclerview and adapter to it, it sends context into next SearchActivity:
public class MainActivity extends BaseActivity {
private static final String LOG_TAG = "mAIN ACTIVITY";
private List<Book> bookList = new ArrayList<>() ;
private RecyclerView recyclerView;
private BookRecyclerViewAdapter bookRecyclerViewAdapter;
private boolean FIRST_TIME_LAUNCH = false ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
bookRecyclerViewAdapter = new BookRecyclerViewAdapter(new ArrayList<Book>(), MainActivity.this);
recyclerView.setAdapter(bookRecyclerViewAdapter);
}
If i try to add button it stands in upper left corner: