pedrovgs / DraggablePanel

Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.
Apache License 2.0
2.99k stars 605 forks source link

UI issue i am facing in draggale pannel #16

Closed manpreetsinghsodhi closed 10 years ago

manpreetsinghsodhi commented 10 years ago

Hello, I am sending you the code i used to set my Ui in case of draggable pannel. It is very nice library and i am stuck on just one part. Screenshot i have given in previous issue i posted. My list is getting visible from bottom, seems like fragment below youtube fragment is not behaving properly and this happens only when i click on list after minimizing youtube player(on dragging it down) . It maximizes well and even video plays good but it is destroying my UI at bottom(screen shot will give u clear view) . I am sending you my code as well //On oncreate protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); setContentView(R.layout.vediofile); flag = 0; lv = (ListView) findViewById(R.id.iv_thumbnail); draggablePanel = (DraggablePanel) findViewById(R.id.draggable_panel); // ButterKnife.inject(this); moviePosterFragment = new MoviePosterFragment(); initializeYoutubeFragment(); hookDraggablePanelListeners(); initializeDraggablePanel();

    lv.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1,
                int position, long arg3) {
  // On click listener of list i am playing a new vedio
          VIDEO_KEY = LoaderTask.vedio.get(position);
            draggablePanel.maximize();
            youtubePlayer.loadVideo(VIDEO_KEY);
            }
    });

This is how i initialize draggable pannel private void initializeDraggablePanel() { // Here i am loading my list first and creating adapter FrameLayout footerLayout = (FrameLayout) getLayoutInflater().inflate( R.layout.footer, null); System.out.println("6666"); ProgressBar footer = (ProgressBar) footerLayout .findViewById(R.id.progressbar);

    lv.addFooterView(footerLayout);

    // --page size = 10--
    ProdAdapter ad = new ProdAdapter(getApplicationContext(), 15, footer,
            "M", "car");

    lv.setAdapter(ad);

    check = true;
    LoaderTask t = new LoaderTask(0, 15, getApplicationContext(), ad, "M",
            "car", check);

    t.execute();

// Here code is same as your demo project for putting top and bottom fragments draggablePanel.setFragmentManager(getSupportFragmentManager()); draggablePanel.setTopFragment(youtubeFragment); moviePosterFragment = new MoviePosterFragment(); // moviePosterFragment.setPoster(VIDEO_POSTER_THUMBNAIL); moviePosterFragment.setPosterTitle(VIDEO_POSTER_TITLE); draggablePanel.setBottomFragment(moviePosterFragment); draggablePanel.initializeView();

}

//code of fragment i am setting at this method setbottomfragment public class MoviePosterFragment extends Fragment {

ImageView thumbnailImageView;

private String videoPosterThumbnail;
private String posterTitle;

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.poster, container, false); thumbnailImageView = (ImageView) view.findViewById(R.id.iv_thumbnail2);

    // ButterKnife.inject(this, view);

     try { Picasso.with(getActivity()).load(
      "http://4.bp.blogspot.com/-BT6IshdVsoA/UjfnTo_TkBI/AAAAAAAAMWk/JvDCYCoFRlQ/s1600/xmenDOFP.wobbly.1.jpg"
      ).placeholder(R.drawable.spiderman_placeholder).into(thumbnailImageView);
      } catch (Exception e) { // TODO Auto-generated catch block
      e.printStackTrace(); }

    return view;
}

Now i am sending you xml i am using

  1. Xml of draggable pannel

<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:draggable_panel="http://schemas.android.com/apk/res-auto" android:id="@+id/fl_container" android:layout_width="match_parent" android:layout_height="match_parent" >

<!-- Movie Thumbnail -->

<ListView
    android:id="@+id/iv_thumbnail"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<!-- DraggablePanehhl -->

<com.github.pedrovgs.DraggablePanel
    android:id="@+id/draggable_panel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    draggable_panel:enable_horizontal_alpha_effect="false"
    draggable_panel:top_fragment_height="@dimen/top_fragment_height"
    draggable_panel:top_fragment_margin_bottom="@dimen/top_fragment_margin"
    draggable_panel:top_fragment_margin_right="@dimen/top_fragment_margin"
    draggable_panel:x_scale_factor="@dimen/x_scale_factor"
    draggable_panel:y_scale_factor="@dimen/y_scale_factor" />

  1. xml of working for bottom fragment <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

    <ImageView android:id="@+id/iv_thumbnail2" android:layout_width="match_parent" android:layout_height="match_parent"

    android:background="#000000"
    /> 


this is my dimen.xml in values folder <?xml version="1.0" encoding="utf-8"?>

``` 200dip ``` 10dip 2 2

I tried to give you my code in brief please help me . Its been 4 days i am stuck on this I am uploading vedio as well for you . have a look please http://videobam.com/IUjYH

manpreetsinghsodhi commented 10 years ago

This is the vedio of problem i am facing http://videobam.com/IUjYH

pedrovgs commented 10 years ago

We are going to close all your problems in #17