本文整理汇总了Java中com.github.lzyzsd.circleprogress.DonutProgress类的典型用法代码示例。如果您正苦于以下问题:Java DonutProgress类的具体用法?Java DonutProgress怎么用?Java DonutProgress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DonutProgress类属于com.github.lzyzsd.circleprogress包,在下文中一共展示了DonutProgress类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.circle_progress_activity_my);
donutProgress = (DonutProgress) findViewById(R.id.donut_progress);
circleProgress = (CircleProgress) findViewById(R.id.circle_progress);
arcProgress = (ArcProgress) findViewById(R.id.arc_progress);
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
donutProgress.setProgress(donutProgress.getProgress() + 1);
circleProgress.setProgress(circleProgress.getProgress() + 1);
arcProgress.setProgress(arcProgress.getProgress() + 1);
}
});
}
}, 1000, 100);
}
示例2: getView
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = inflater.inflate(R.layout.cpu_wakelock_row, parent, false);
TextView wakelockName = row.findViewById(R.id.cpu_wakelock_name);
TextView packageNameView = row.findViewById(R.id.cpu_wakelock_duration);
TextView wakelockDetail = row.findViewById(R.id.cpu_wakelock_count);
ImageView packageIcon = row.findViewById(R.id.package_icon);
DonutProgress progress = row.findViewById(R.id.cpu_wakelock_progress);
Wakelock wakelock = partialWakelocks.get(position);
String packageName=wakelock.getFqn(UidNameResolver.getInstance());
Drawable drawable = wakelock.getIcon(UidNameResolver.getInstance());
if (drawable != null) {
packageIcon.setImageDrawable(drawable);
}
wakelockName.setText(wakelock.getName());
packageNameView.setText(packageName);
wakelockDetail.setText(DateUtils.formatDuration(wakelock.getDuration())
+ " Count: " + wakelock.getCount());
progress.setMax(totalTime);
progress.setProgress((wakelock.getDuration()*100)/totalTime);
return row;
}
示例3: getView
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup container) {
View row = inflater.inflate(R.layout.alarm_trigger_custom_list_item1, container, false);
TextView AlarmPackageName = row.findViewById(R.id.alarm_package_name);
TextView WakeupCount = row.findViewById(R.id.wakeup_count);
TextView name = row.findViewById(R.id.alarm_appname);
ImageView icon = row.findViewById(R.id.alarm_icon);
DonutProgress progress = row.findViewById(R.id.donut_progress);
Alarm alarm = alarms.get(position);
icon.setImageDrawable(alarm.getIcon(uidNameResolver));
String packageName = alarm.getPackageName();
AlarmPackageName.setText(uidNameResolver.getLabel(packageName));
name.setText(packageName);
WakeupCount.setText("x" + alarm.getWakeups() + " times");
progress.setMax(100);
progress.setProgress(alarm.getWakeups() * 100 / totaltime);
return row;
}
示例4: getView
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View rowView = inflater.inflate(R.layout.kernel_wakelock_row, parent, false);
TextView mKernelWakelock = rowView.findViewById(R.id.kernel_wakelock_name);
TextView WakeupInfo = rowView.findViewById(R.id.wakelock_duration);
TextView wakeUpCount = rowView.findViewById(R.id.kernel_wakelock_count);
DonutProgress progress = rowView.findViewById(R.id.donut_progress);
NativeKernelWakelock nativeWakeLock = kernelWakelocks.get(position);
String kernelWakelock = kernelWakelocks.get(position).getName();
mKernelWakelock.setText(kernelWakelock);
WakeupInfo.setText(SysUtils.secToString(nativeWakeLock.getDuration() / 1000));
progress.setMax(100);
progress.setProgress( nativeWakeLock.getDuration() * 100 / totaltime);
wakeUpCount.setText("x" + nativeWakeLock.getCount() + " " + context.getString(R.string.times));
return rowView;
}
示例5: ViewHolder
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
name = (TextView) itemView.findViewById(R.id.name);
author = (TextView) itemView.findViewById(R.id.author);
duration = (TextView) itemView.findViewById(R.id.duration);
progressTxt = (TextView) itemView.findViewById(R.id.progress_text);
progress = (DonutProgress) itemView.findViewById(R.id.donut_progress);
photo = (CircleImageView) itemView.findViewById(R.id.profile_image);
}
示例6: VH
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
VH(View itemView) {
super(itemView);
appImage = (ImageView) itemView.findViewById(R.id.app_image);
appName = (TextView) itemView.findViewById(R.id.app_name);
developer = (TextView) itemView.findViewById(R.id.developer);
rating = (TextView) itemView.findViewById(R.id.rating);
progressBar = (DonutProgress) itemView.findViewById(R.id.download_progress);
download = (ImageView) itemView.findViewById(R.id.download);
download.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (onItemClickListener != null) {
onItemClickListener.downloadButtonClicked(getAdapterPosition(),
appsList.get(getAdapterPosition()).getDownloadLink());
appsList.get(getAdapterPosition()).setDownloading(true);
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(0f);
download.setVisibility(View.GONE);
}
}
});
}
示例7: onViewCreated
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
cropImageView = (CropImageView) view.findViewById(R.id.cropImageView);
cropImageView.setDrawingCacheEnabled(true);
//cropImageView.setAspectRatio(10, 10);
//cropImageView.setFixedAspectRatio(true);
imageLoadFail = (ImageView)view.findViewById(R.id.imageLoadFail);
circleLoading = (DonutProgress)view.findViewById(R.id.circleLoading);
llBottomOptions = (LinearLayout)view.findViewById(R.id.llBottomOptions);
done = (TextView)view.findViewById(R.id.done);
cancel = (TextView)view.findViewById(R.id.cancel);
done.setOnClickListener(mOnClickListener);
cancel.setOnClickListener(mOnClickListener);
}
示例8: onViewCreated
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
rootLayout = (FrameLayout) view.findViewById(R.id.rootLayout);
circleLoading = (DonutProgress)view.findViewById(R.id.circleLoading);
imageLoadFail = (ImageView) view.findViewById(R.id.imageLoadFail);
}
示例9: onPreExecute
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@Override
protected void onPreExecute() {
super.onPreExecute();
downloadDir = Helper.getDownloadDir("", ImporterActivity.this);
donutProgress = (DonutProgress) findViewById(R.id.donut_progress);
tvCurrentStatus = (TextView) findViewById(R.id.tvCurrentStatus);
fakkuDroidDB = new FakkuDroidDB(ImporterActivity.this);
}
示例10: LoadingSpinnerView
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
public LoadingSpinnerView(final Context context) {
super(context);
final TypedArray typedArray = context.obtainStyledAttributes(new int[]{
R.attr.rrLoadingRingForegroundCol,
R.attr.rrLoadingRingBackgroundCol
});
final int foreground = typedArray.getColor(0, Color.MAGENTA);
final int background = typedArray.getColor(1, Color.GREEN);
typedArray.recycle();
mProgressView = new DonutProgress(context);
mProgressView.setIndeterminate(true);
mProgressView.setFinishedStrokeColor(foreground);
mProgressView.setUnfinishedStrokeColor(background);
final int progressStrokeWidthPx = General.dpToPixels(context, 10);
mProgressView.setUnfinishedStrokeWidth(progressStrokeWidthPx);
mProgressView.setFinishedStrokeWidth(progressStrokeWidthPx);
mProgressView.setStartingDegree(-90);
mProgressView.initPainters();
addView(mProgressView);
final int progressDimensionsPx = General.dpToPixels(context, 100);
mProgressView.getLayoutParams().width = progressDimensionsPx;
mProgressView.getLayoutParams().height = progressDimensionsPx;
((LayoutParams)mProgressView.getLayoutParams()).addRule(CENTER_IN_PARENT);
}
示例11: HorizontalSwipeProgressOverlay
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
public HorizontalSwipeProgressOverlay(final Context context) {
super(context);
final View background = new View(context);
final int backgroundDimensionsPx = General.dpToPixels(context, 200);
background.setBackgroundColor(Color.argb(127, 0, 0, 0));
addView(background);
background.getLayoutParams().width = backgroundDimensionsPx;
background.getLayoutParams().height = backgroundDimensionsPx;
((LayoutParams)background.getLayoutParams()).addRule(RelativeLayout.CENTER_IN_PARENT);
mIcon = new ImageView(context);
mIcon.setImageResource(R.drawable.ic_action_forward_dark);
mCurrentIconResource = R.drawable.ic_action_forward_dark;
addView(mIcon);
((LayoutParams)mIcon.getLayoutParams()).addRule(RelativeLayout.CENTER_IN_PARENT);
mProgress = new DonutProgress(context);
addView(mProgress);
((LayoutParams)mProgress.getLayoutParams()).addRule(RelativeLayout.CENTER_IN_PARENT);
final int progressDimensionsPx = General.dpToPixels(context, 150);
mProgress.getLayoutParams().width = progressDimensionsPx;
mProgress.getLayoutParams().height = progressDimensionsPx;
mProgress.setFinishedStrokeColor(Color.RED);
mProgress.setUnfinishedStrokeColor(Color.argb(127, 0, 0, 0));
final int progressStrokeWidthPx = General.dpToPixels(context, 15);
mProgress.setUnfinishedStrokeWidth(progressStrokeWidthPx);
mProgress.setFinishedStrokeWidth(progressStrokeWidthPx);
mProgress.setStartingDegree(-90);
mProgress.initPainters();
setVisibility(GONE);
}
示例12: onCreate
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
donutProgress = (DonutProgress) findViewById(R.id.donut_progress);
/*AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(this, R.animator.progress_anim2);
set.setTarget(donutProgress);
set.start();*/
/*ValueAnimator animation = ValueAnimator.ofObject(new IntEvaluator(), 0, 100);
animation.setDuration(1000);
animation.start();*/
/*PropertyValuesHolder donutAlphaProperty = PropertyValuesHolder.ofFloat("alpha", 0f, 1f);
PropertyValuesHolder donutProgressProperty = PropertyValuesHolder.ofInt("donut_progress", 0, 100);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(donutProgress, donutAlphaProperty, donutProgressProperty);
animator.setDuration(2000);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.start();*/
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
boolean a = false;
if (a) {
ObjectAnimator anim = ObjectAnimator.ofInt(donutProgress, "progress", 0, 10);
anim.setInterpolator(new DecelerateInterpolator());
anim.setDuration(500);
anim.start();
} else {
AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(MyActivity.this, R.animator.progress_anim);
set.setInterpolator(new DecelerateInterpolator());
set.setTarget(donutProgress);
set.start();
}
}
});
}
}, 0, 2000);
}
示例13: openImage
import com.github.lzyzsd.circleprogress.DonutProgress; //导入依赖的package包/类
private void openImage(final DonutProgress progressBar, URI uri) {
if(mImageInfo.mediaType != null) {
Log.i(TAG, "Media type " + mImageInfo.mediaType + " detected");
if(mImageInfo.mediaType == ImageInfo.MediaType.IMAGE) {
final PrefsUtility.ImageViewMode imageViewMode = PrefsUtility.pref_behaviour_imageview_mode(
this,
PreferenceManager.getDefaultSharedPreferences(this));
if(imageViewMode == PrefsUtility.ImageViewMode.EXTERNAL_BROWSER) {
openInExternalBrowser();
return;
} else if(imageViewMode == PrefsUtility.ImageViewMode.INTERNAL_BROWSER) {
revertToWeb();
return;
}
} else if(mImageInfo.mediaType == ImageInfo.MediaType.GIF) {
final PrefsUtility.GifViewMode gifViewMode = PrefsUtility.pref_behaviour_gifview_mode(
this,
PreferenceManager.getDefaultSharedPreferences(this));
if(gifViewMode == PrefsUtility.GifViewMode.EXTERNAL_BROWSER) {
openInExternalBrowser();
return;
} else if(gifViewMode == PrefsUtility.GifViewMode.INTERNAL_BROWSER) {
revertToWeb();
return;
}
} else if(mImageInfo.mediaType == ImageInfo.MediaType.VIDEO) {
final PrefsUtility.VideoViewMode videoViewMode = PrefsUtility.pref_behaviour_videoview_mode(
this,
PreferenceManager.getDefaultSharedPreferences(this));
if(videoViewMode == PrefsUtility.VideoViewMode.EXTERNAL_BROWSER) {
openInExternalBrowser();
return;
} else if(videoViewMode == PrefsUtility.VideoViewMode.INTERNAL_BROWSER) {
revertToWeb();
return;
}
}
}
Log.i(TAG, "Proceeding with download");
makeCacheRequest(progressBar, uri);
}