0

I'm following this link and using this exact same code to make this flowing drawer but i'm using eclipse and for the life of me i can't figure out the problem. Iam using exact this code so i don't know what to post here. I'll just post my main activity here. In logcat its crashing on setcontentview. I'll also post my .xml file

public class MainActivity extends AppCompatActivity {

private RecyclerView rvFeed;
private LeftDrawerLayout mLeftDrawerLayout;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    System.out.println("Calling Layout");
    setContentView(R.layout.activity_main);
    System.out.println("Layout Called");
    setupToolbar();

    mLeftDrawerLayout = (LeftDrawerLayout) findViewById(R.id.id_drawerlayout);
    rvFeed = (RecyclerView) findViewById(R.id.rvFeed);

    FragmentManager fm = getSupportFragmentManager();
    MyMenuFragment mMenuFragment = (MyMenuFragment) fm.findFragmentById(R.id.id_container_menu);
    FlowingView mFlowingView = (FlowingView) findViewById(R.id.sv);
    if (mMenuFragment == null) {
        fm.beginTransaction().add(R.id.id_container_menu, mMenuFragment = new MyMenuFragment()).commit();
    }
    mLeftDrawerLayout.setFluidView(mFlowingView);
    mLeftDrawerLayout.setMenuFragment(mMenuFragment);
    setupFeed();

}

protected void setupToolbar() {
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    toolbar.setNavigationIcon(R.drawable.ic_menu_white);

    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mLeftDrawerLayout.toggle();
        }
    });
}

private void setupFeed() {
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this) {
        @Override
        protected int getExtraLayoutSpace(RecyclerView.State state) {
            return 300;
        }
    };
    rvFeed.setLayoutManager(linearLayoutManager);

    FeedAdapter feedAdapter = new FeedAdapter(this);
    rvFeed.setAdapter(feedAdapter);
    feedAdapter.updateItems();
}

@Override
public void onBackPressed() {
    if (mLeftDrawerLayout.isShownMenu()) {
        mLeftDrawerLayout.closeDrawer();
    } else {
        super.onBackPressed();
    }
}
}





<com.abc.epicfloatinglibrary.LeftDrawerLayout
android:id="@+id/id_drawerlayout"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
>
<!--content-->
<android.support.v7.design.widget.CoordinatorLayout
    android:id="@+id/content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rvFeed"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include
            android:id="@+id/toolbar"
            layout="@layout/view_feed_toolbar" />
    </android.support.design.widget.AppBarLayout>

<!--menu-->
<RelativeLayout
    android:layout_width="280dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:clipChildren="false"
    >

    <com.abc.epicfloatinglibrary.FlowingView
        android:id="@+id/sv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <FrameLayout
        android:id="@+id/id_container_menu"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_marginRight="25dp"
        android:paddingRight="10dp"
        />

</RelativeLayout>

ravi raghav
  • 85
  • 11
  • can you post the logcat notation here? – iSandeep Jan 26 '16 at 18:59
  • it's now allowing me to post the entire log in here but here is some of it : I/System.out: Calling Layout : D/AndroidRuntime(11588): Shutting down VM : W/dalvikvm(11588): threadid=1: thread exiting with uncaught exception (group=0x430f3140) : E/AndroidRuntime(11588): FATAL EXCEPTION: main : E/AndroidRuntime(11588): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.anshya.epicfloatingdrawerdemo/com.anshya.epicfloatingdrawerdemo.MainActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class android.support.v7.design.widget.CoordinatorLayout – ravi raghav Jan 27 '16 at 14:57

1 Answers1

1

Try the following.

  1. Clean your project,
  2. Rebuild your project,
  3. Get Build on Gradle.

If you'll not get it run, check your build.gradle file whether you have added that library in dependencies.

David Medenjak
  • 33,993
  • 14
  • 106
  • 134
Nanda Gopal
  • 2,519
  • 1
  • 17
  • 25