Search in sources :

Example 1 with ListEmptyView

use of com.abewy.android.apps.klyph.view.ListEmptyView in project Klyph by jonathangerbaud.

the class KlyphGridFragment method defineEmptyView.

protected void defineEmptyView() {
    if (gridView != null) {
        ListEmptyView lev = new ListEmptyView(getActivity());
        ((ViewGroup) gridView.getParent()).addView(lev);
        Log.d("KlyphGridFragment", "define empty view " + lev);
        gridView.setEmptyView(lev);
    }
}
Also used : ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView) ViewGroup(android.view.ViewGroup)

Example 2 with ListEmptyView

use of com.abewy.android.apps.klyph.view.ListEmptyView in project Klyph by jonathangerbaud.

the class ImageFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    progress = (ProgressBar) view.findViewById(R.id.progress);
    emptyView = (ListEmptyView) view.findViewById(R.id.emptyView);
    imageView = (ImageViewTouch) view.findViewById(R.id.image);
    slidingDrawer = (KlyphSlidingDrawer) view.findViewById(R.id.sliding_drawer);
    captionInfo = (ViewGroup) view.findViewById(R.id.caption_info);
    profileImage = (ImageView) view.findViewById(R.id.author_profile_image);
    authorName = (TextView) view.findViewById(R.id.author_name);
    postTime = (TextView) view.findViewById(R.id.post_time);
    sendTextEdit = (EditText) view.findViewById(R.id.send_text_edit);
    sendButton = (ImageButton) view.findViewById(R.id.send_button);
    emptyView.setText(R.string.cannot_find_photo);
    getListView().setCacheColorHint(AttrUtil.getColor(getActivity(), android.R.attr.windowBackground));
    // imageView.setOnScaleListener(this);
    imageView.setSingleTapListener(new ImageViewTouch.OnImageViewTouchSingleTapListener() {

        @Override
        public void onSingleTapConfirmed() {
            toggleBarVisibility();
        }
    });
    sendButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            handlePostComment();
        }
    });
    defineEmptyText(R.string.no_comment);
    adapter = new MultiObjectAdapter(getListView(), SpecialLayout.PHOTO);
    setListAdapter(adapter);
    // setRequestType(Query.PHOTO_AND_COMMENTS);
    setRequestType(Query.PHOTO);
    super.onViewCreated(view, savedInstanceState);
    // Crash if before super.onViewCreated(view, savedInstanceState);
    getListView().getAdapter().registerDataSetObserver(observer);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) ImageViewTouch(it.sephiroth.android.library.imagezoom.ImageViewTouch) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView) ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView)

Example 3 with ListEmptyView

use of com.abewy.android.apps.klyph.view.ListEmptyView in project Klyph by jonathangerbaud.

the class AlbumActivity method showError.

private void showError() {
    ListEmptyView lev = new ListEmptyView(this);
    lev.setText(R.string.request_error);
    addContentView(lev, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    setLoadingViewVisible(false);
}
Also used : ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView) LayoutParams(android.view.ViewGroup.LayoutParams)

Example 4 with ListEmptyView

use of com.abewy.android.apps.klyph.view.ListEmptyView in project Klyph by jonathangerbaud.

the class KlyphDialogFragment method defineEmptyView.

/**
 * Create, add and set the list empty view Override this method if you want
 * a custom empty view, or if you replaced listview by a gridview for
 * example
 */
protected void defineEmptyView() {
    ListEmptyView lev = new ListEmptyView(getActivity());
    ((ViewGroup) getListView().getParent()).addView(lev);
    getListView().setEmptyView(lev);
    if (this.emptyText > 0)
        setEmptyText(emptyText);
}
Also used : ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView) ViewGroup(android.view.ViewGroup)

Aggregations

ListEmptyView (com.abewy.android.apps.klyph.view.ListEmptyView)4 ViewGroup (android.view.ViewGroup)2 View (android.view.View)1 LayoutParams (android.view.ViewGroup.LayoutParams)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)1 ImageViewTouch (it.sephiroth.android.library.imagezoom.ImageViewTouch)1