Comments (16)
Have you call mElasticDownloadView.startIntro();
??
from elasticprogressbar.
sorry
the download image didnot show when app run. when i click on the tick button then the progress bar display
from elasticprogressbar.
Provide me a code of your activity
from elasticprogressbar.
ok
from elasticprogressbar.
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.
please solve this
from elasticprogressbar.
Comment this line and try:
OptionView.noBackground = true;
from elasticprogressbar.
when i comment this line then whole screen turn to primarycolor
from elasticprogressbar.
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.
hello ????
from elasticprogressbar.
Please send me by email your zip project
from elasticprogressbar.
Unable to change the red color in background how to change that red color at back
from elasticprogressbar.
@mahendrushivam use this method:
OptionView.setBackgroundColorSquare(int color);
call this before setContentView()
of Activity
from elasticprogressbar.
from elasticprogressbar.
Before set view of fragment!
from elasticprogressbar.
what about adapter?
from elasticprogressbar.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticprogressbar.