Giter Site home page Giter Site logo

progress-activity's People

Contributors

ravidsrk avatar vlonjat-gashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

progress-activity's Issues

Unsupported Vector Resources

When using vector image resources for reverse compatible devices (API level 17) we get
android.content.res.Resources$NotFoundException: File res/drawable/ic_no_wifi.xml from drawable resource ID #0x7f02009b. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.

How to hide?

I'm sorry to ask this, but after doing progressActivity.showLoading() - I don't find any method like progressActivity.StopLoading; can you please point me to the right method to hide loading? Thanks!

contentViews is not Incomplete

If I want to show empty or error layout ,and want to show a part of widget ,And The layout is a child in other widget . and it take no effect. i think the contentViews is incomplete, it must be include the all child view

SkipIds is not working

I have implemented this library in my project, it is very useful library to reduce code and showing good user interface.

It works fine for loading, showing content but when I used skip id in empty content, it is not working, it is taking whole page to show empty content.
` List skipIds = new ArrayList<>();

skipIds.add(R.id.aml_rlUser);
loadingLayout.showEmpty(imgResource, title, message,skipIds);`

cannot process visibility of indirect children of ProgressActivity

I just meet with this problem and I give out some ways to solve this problem.FYI

in your sourcecode you use this code

`

public void addView(@NonNull View child, int index, ViewGroup.LayoutParams params) {

    super.addView(child, index, params);
    if (child.getTag() == null || (!child.getTag().equals(TAG_LOADING) &&
            !child.getTag().equals(TAG_EMPTY) && !child.getTag().equals(TAG_ERROR))) {
        contentViews.add(child);
    }

}

`

and process the visibility every time we change to different state.
`

private void setContentVisibility(boolean visible, List<Integer> skipIds) {

    for (View v : contentViews) {
        if (!skipIds.contains(v.getId())) {
            v.setVisibility(visible ? View.VISIBLE : View.GONE);
        }
    }

}

`

which means you will only process the view component in
List<View> contentViews = new ArrayList<>();

but the addView method will not add the child views of a child viewgroup .which means a ImageView is inside a RelativeLayout,and the RelativeLayout is a child of ProgressActivity . In this context ,the ImageView will not be add to the contentViews instance .

so I made some changes

`

public void addView(@NonNull View child, int index, ViewGroup.LayoutParams params) {

    super.addView(child, index, params);
    if (child.getTag() == null || (!child.getTag().equals(TAG_LOADING) &&
            !child.getTag().equals(TAG_EMPTY) && !child.getTag().equals(TAG_ERROR))) {
         //            contentViews.add(child);
        contentViews.addAll(getAllChildren(child));
        Log.i("ProgressActivity", "sub children count of ProgressActivity is" + contentViews.size());
    }

}


/**
 * save all of the direct and  indirect children views
 *
 * @param
 */
private List<View> getAllChildren(View v) {

    if (!(v instanceof ViewGroup)) {
        List<View> viewArrayList = new ArrayList<>();
        viewArrayList.add(v);
        return viewArrayList;
    } else {
        if (((ViewGroup) v).getChildCount() == 0) {
            List<View> viewArrayList = new ArrayList<>();
            viewArrayList.add(v);
            return viewArrayList;
        } else {
            List<View> result = new ArrayList<>();

            ViewGroup vg = (ViewGroup) v;
            for (int i = 0; i < vg.getChildCount(); i++) {

                View child = vg.getChildAt(i);

                List<View> viewArrayList = new ArrayList<>();
                viewArrayList.add(v);
                viewArrayList.addAll(getAllChildren(child));

                result.addAll(viewArrayList);
            }
            return result;
        }
    }
}`

now the instance of contentViews includes all of the chilrend and grandson ....component.

one more changes is needed:
`

 /**
   * set children visibility of StatusLayout
    *
   * @param visible
    * @param skipIds
   */
private void setContentVisibility(boolean visible, List<Integer> skipIds) {
    for (View v : contentViews) {
        if (!skipIds.contains(v.getId())) {
            v.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
        }
        // when visible is true,which means set content Layout, the skipIds compoent need to be hide
        if (visible) {
            if (skipIds.contains(v.getId())) {
                v.setVisibility(View.INVISIBLE);
            }
        }
        //set parent to be visible when child want to be visible
        if (v.getVisibility() == View.VISIBLE) {
            setParentToVisible(v);
        }
    }
}

`

`

public void setParentToVisible(View v) {
    ViewParent mParent = v.getParent();
    if (mParent != null && mParent instanceof ViewGroup) {
        ((ViewGroup) mParent).setVisibility(View.VISIBLE);
        if (mParent.getParent() != null) {
            setParentToVisible((View) mParent);
        }
    }

}

`

the part of code which I add .means the example ImageView I told in this issue before if i skip to hide it .I needed to set it to visible .but at the same time ,we need to set its parent to be visible ,which is the RelativeLayout -the child of ProgressActivity.

For anyone who meet with this problem's recommendation.

Can't see progress bar

<com.vlonjatg.progressactivity.ProgressActivity xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/progressActivity"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/box_background"
    android:padding="12dp"
    style="@style/ProgressActivity">

    <ExpandableListView
        android:id="@+id/exp_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:childDivider="@color/box_background"
        android:divider="@color/box_background"
        android:dividerHeight="12dp" />

</com.vlonjatg.progressactivity.ProgressActivity>

I am using above code but I can't see any loading progress bar after calling progressActivity.showLoading();

suggestion

smart design.
it will be better if empty view have a retry button

showError works only for first time

Firstly, its good library thanks for this!. I am using this library to show network error, in the layout the set these: app:loadingBackgroundColor="#FFFFFF" app:emptyBackgroundColor="#fbc02d" app:errorBackgroundColor="@color/disabled_grey" app:errorButtonTextColor="@color/white" app:errorContentTextColor="@color/Red"
So when I showErr its background must be grey, and yes it works for the first time. Then I have a retry button and again I check the network stat, if not good I call the same showErr method it shows the layout having the drawable I supplied and also the retry button. And the point is it shows me the content of my xml file wic is editable and Ui interactive but it was supposed to be was, it must have shown a grey background (as per this : app:errorBackgroundColor="@color/disabled_grey")

error Handling

how to handle error on click of Try again for ex. in the case of no connection available..
we have to manually hide or show progress Activity then what’s the meaning of using of this lib..we can achieve this is manually also

Attributes not resolved

Attributes are not resolved. There is a mismatch between application package and library.

package="com.vlonjatg.progressactivity"
compile 'com.vlonjatg.android:progress-activity:1.1.1'

App is crashing on ShowError

When showError is called on progressActivity then app crashes.

Attempt to invoke virtual method 'android.content.res.Resources android.support.v4.app.r.getResources()' on a null object reference

I have also checked if progessActivity is not null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.