GithubHelp home page GithubHelp logo

IntroView about elasticprogressbar HOT 16 OPEN

michelelacorte avatar michelelacorte commented on June 25, 2024
IntroView

from elasticprogressbar.

Comments (16)

michelelacorte avatar michelelacorte commented on June 25, 2024

Have you call mElasticDownloadView.startIntro(); ??

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

sorry
the download image didnot show when app run. when i click on the tick button then the progress bar display
screenshot_2016-06-24-18-08-44

from elasticprogressbar.

michelelacorte avatar michelelacorte commented on June 25, 2024

Provide me a code of your activity

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

ok

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;

import it.michelelacorte.elasticprogressbar.ElasticDownloadView;
import it.michelelacorte.elasticprogressbar.OptionView;

public class MainActivity extends AppCompatActivity {
ElasticDownloadView mElasticDownloadView;
CoordinatorLayout mCoordinatorLayout;
FloatingActionButton fabStart;
FloatingActionButton fabCancel;

/*

Fake download file
*/
private int progressStatus = 0;
private Handler handler = new Handler();
private long fileSize = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    /*
    VARIOUS OPTION
     */
   // OptionView.setBackgroundColorSquare(R.color.colorAccent);
    OptionView.noBackground = true;
   // OptionView.setColorCloud(R.color.colorPrimary);
    //OptionView.setColorProgressBar(R.color.red);
    //OptionView.setColorProgressBarInProgress(R.color.darkblue);
    //OptionView.setColorProgressBarText(R.color.darkblue);
    //OptionView.setColorSuccess(R.color.darkblue);
    //OptionView.setColorFail(R.color.orange);
    //OptionView.noIntro = true;


    setContentView(R.layout.activity_main);
    mElasticDownloadView = (ElasticDownloadView)findViewById(R.id.elastic_download_view);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    mCoordinatorLayout = (CoordinatorLayout)findViewById(R.id.coordinatorLayout);
    mElasticDownloadView = (ElasticDownloadView)findViewById(R.id.elastic_download_view);
    fabStart = (FloatingActionButton) findViewById(R.id.fabStart);
    fabCancel = (FloatingActionButton) findViewById(R.id.fabCancel);
    assert fabCancel != null;
    fabCancel.setVisibility(View.INVISIBLE);

    fabCancel.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Snackbar.make(mCoordinatorLayout, "Progress Bar Reloaded!", Snackbar.LENGTH_LONG).show();
            mElasticDownloadView.setProgress(0);
            fabCancel.setVisibility(View.INVISIBLE);
            fabStart.setVisibility(View.VISIBLE);
        }
    });

    fabStart.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(mCoordinatorLayout, "Progress Bar Started!", Snackbar.LENGTH_LONG).show();
            mElasticDownloadView.startIntro();
            fabCancel.setVisibility(View.VISIBLE);
            fabStart.setVisibility(View.INVISIBLE);
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    while (progressStatus < 100) {
                        progressStatus = downloadFile();
                        handler.post(new Runnable() {
                            public void run() {
                                //Set progress dinamically
                                mElasticDownloadView.setProgress(progressStatus);
                                Log.d("Progress:", "" + mElasticDownloadView.getProgress());
                            }
                        });
                    }
                    if (progressStatus >= 100) {
                        mElasticDownloadView.success();
                    }
                }
            }, 1000);
        }
    });

}


//Fake download file example
public int downloadFile() {

    while (fileSize <= 1000000) {

        fileSize++;

        if (fileSize == 100000) {
            return 10;

        } else if (fileSize == 200000) {
            return 20;

        } else if (fileSize == 300000) {
            return 30;

        } else if (fileSize == 400000) {
            return 40;

        } else if (fileSize == 500000) {

            return 50;
        } else if (fileSize == 700000) {

            return 70;
        } else if (fileSize == 800000) {

            return 80;
        } else if (fileSize == 900000) {

            return 90;
        }
    }

    return 100;

}

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

please solve this

from elasticprogressbar.

michelelacorte avatar michelelacorte commented on June 25, 2024

Comment this line and try:

OptionView.noBackground = true;

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

when i comment this line then whole screen turn to primarycolor
screenshot_2016-06-24-20-35-59

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

this is the main_acitvity.xml

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_main" />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fabStart"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="@dimen/fab_margin"
    android:src="@drawable/ic_action" />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fabCancel"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|start"
    android:layout_margin="@dimen/fab_margin"
    android:src="@drawable/ic_action_cancel" />

<it.michelelacorte.elasticprogressbar.ElasticDownloadView
    android:id="@+id/elastic_download_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerInParent="true"
    />

</android.support.design.widget.CoordinatorLayout>

from elasticprogressbar.

Danishbutt1122 avatar Danishbutt1122 commented on June 25, 2024

hello ????

from elasticprogressbar.

michelelacorte avatar michelelacorte commented on June 25, 2024

Please send me by email your zip project

from elasticprogressbar.

mahendrushivam avatar mahendrushivam commented on June 25, 2024

Unable to change the red color in background how to change that red color at back

from elasticprogressbar.

michelelacorte avatar michelelacorte commented on June 25, 2024

@mahendrushivam use this method:

OptionView.setBackgroundColorSquare(int color);

call this before setContentView() of Activity

from elasticprogressbar.

mahendrushivam avatar mahendrushivam commented on June 25, 2024

from elasticprogressbar.

michelelacorte avatar michelelacorte commented on June 25, 2024

Before set view of fragment!

from elasticprogressbar.

sakshiigoyal avatar sakshiigoyal commented on June 25, 2024

what about adapter?

from elasticprogressbar.

Related Issues (7)

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.