本文整理汇总了Java中com.echo.holographlibrary.PieGraph类的典型用法代码示例。如果您正苦于以下问题:Java PieGraph类的具体用法?Java PieGraph怎么用?Java PieGraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PieGraph类属于com.echo.holographlibrary包,在下文中一共展示了PieGraph类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.echo.holographlibrary.PieGraph; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.organizer_ev_overview_fragment, container, false);
pg = (PieGraph)rootView.findViewById(R.id.piegraph);
if (getActivity().getIntent() != null) {
Intent intenEv = getActivity().getIntent();
mEventsController = new EventsController();
tvTitle = (TextView) rootView.findViewById(R.id.tvOrganizerEvTitle);
tvEvdateTime = (TextView) rootView.findViewById(R.id.tvOrganizerEvDate);
tvOrgaEvTicketSoldex = (TextView) rootView.findViewById(R.id.tvOrgaEvTicketSolde);
tvOrgaEvTicketPendingx = (TextView) rootView.findViewById(R.id.tvOrgaEvTicketPending);
tvOrgaEvTicketdispo = (TextView) rootView.findViewById(R.id.tvOrgaEvTicketAvail);
TvEvEarningsx = (TextView) rootView.findViewById(R.id.TvEvEarnings);
mlblVendusValuex = (TextView) rootView.findViewById(R.id.lblVendusValue);
TvTicketsPendingValuex = (TextView) rootView.findViewById(R.id.TvTicketsPendingValue);
mtvTickets_availableVal = (TextView) rootView.findViewById(R.id.tvTickets_availableVal);
String EvTitle = intenEv.getStringExtra(EventsController.TAG_NAME);
String EvdateTime = intenEv.getStringExtra(EventsController.TAG_dateTime);
EvID = intenEv.getStringExtra(EventsController.TAG_ID);
tvTitle.setText(EvTitle);
tvEvdateTime.setText(EvdateTime);
}
OrganizerEvParticipantsFragment pariticpants = new OrganizerEvParticipantsFragment();
getFragmentManager().beginTransaction().replace(R.id.fragment_container_pariticpant, pariticpants).commit();
new GetSingleEventPacks().execute();
return rootView;
}
开发者ID:alouanemed,项目名称:EvGuide,代码行数:36,代码来源:OrganizerEvOverViewFragment.java
示例2: initPieGraph
import com.echo.holographlibrary.PieGraph; //导入依赖的package包/类
/**
* パイグラフを初期化する。
*/
private void initPieGraph() {
PieGraph pieGraph = (PieGraph) findViewById(R.id.piegraph);
pieGraph.addSlice(createPieForGraph("#99CC00", "米", 20));
pieGraph.addSlice(createPieForGraph("#FFBB33", "パン", 15));
pieGraph.addSlice(createPieForGraph("#AA66CC", "シリアル", 8));
pieGraph.addSlice(createPieForGraph("#CC2266", "キャッサバ", 3));
pieGraph.setOnSliceClickedListener(new OnSliceClickedListener() {
@Override
public void onClick(int index) {
}
});
}
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:16,代码来源:HoloGraphLibrarySampleActivity.java
示例3: onStart
import com.echo.holographlibrary.PieGraph; //导入依赖的package包/类
@Override
public void onStart(Intent intent, int startId)
{
broadcastReceiver=new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if(remoteViews==null||context==null||appWidgetManager==null||!mPower.isScreenOn())
return;
int batteryPct=intent.getIntExtra("level",100);
PieSlice slice=new PieSlice(),_slice=new PieSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(batteryPct);
_slice.setColor(Color.parseColor("#0099CC00"));
_slice.setValue(100 - batteryPct + 0.00001f);
pieGraph=new PieGraph(context);
pieGraph.measure(200, 200);
pieGraph.layout(0, 0, 200, 200);
pieGraph.setDrawingCacheEnabled(true);
pieGraph.addSlice(slice);
pieGraph.addSlice(_slice);
pieGraph.setInnerCircleRatio(150);
for (PieSlice s : pieGraph.getSlices())
s.setGoalValue(s.getValue());
pieGraph.setDuration(1000);
pieGraph.setInterpolator(new AccelerateDecelerateInterpolator());
pieGraph.animateToGoalValues();
pieGraph.setPadding(3);
Bitmap bitmap=pieGraph.getDrawingCache();
Canvas canvas=new Canvas(bitmap);
Paint paint=new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(Color.BLACK);
paint.setTextSize(18);
paint.setShadowLayer(1f,0f,1f,Color.WHITE);
Rect bounds=new Rect();
paint.getTextBounds(batteryPct+" %",0,new String(batteryPct+" %").length(),bounds);
int x=(bitmap.getWidth()-bounds.width())/2;
int y=(bitmap.getHeight()+bounds.height())/2;
canvas.drawText(batteryPct+" %",x,y,paint);
if(remoteViews!=null&&appWidgetManager!=null&&context!=null) {
remoteViews.setImageViewBitmap(R.id.widget_battery_graph, bitmap);
remoteViews.setTextViewText(R.id.widget_battery_voltage, getString(R.string.voltage)+" : " + intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE, 0) + " mV");
remoteViews.setTextViewText(R.id.widget_battery_source, getString(R.string.ba_power_source)+" : " + (intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) == 0 ? "Battery" : "Charge"));
remoteViews.setTextViewText(R.id.widget_battery_type, getString(R.string.ba_type)+" : "+ intent.getExtras().getString(BatteryManager.EXTRA_TECHNOLOGY));
remoteViews.setTextViewText(R.id.widget_battery_temperature, getString(R.string.temperature)+" : " + ((float) intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0) / 10) + " °C");
remoteViews.setTextViewText(R.id.widget_battery_health, getString(R.string.health)+" : " + getBatteryHealth(intent.getIntExtra(BatteryManager.EXTRA_HEALTH, 0)));
appWidgetManager.updateAppWidget(widget, remoteViews);
}
pieGraph.removeSlices();
}
};
if(context!=null)
context.getApplicationContext().registerReceiver(broadcastReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:54,代码来源:BatteryWidget.java
示例4: onCreateView
import com.echo.holographlibrary.PieGraph; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState)
{
rootView=inflater.inflate(R.layout.fragment_battery,container,false);
getActivity().setTitle(getString(R.string.battery));
IntentFilter ifilter=new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
batteryPct=-1;
pieGraph=(PieGraph)rootView.findViewById(R.id.graph);
batteryInfo=new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
batteryPct=intent.getIntExtra("level",100);
pieGraph.removeSlices();
PieSlice slice=new PieSlice(),_slice=new PieSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(batteryPct);
_slice.setColor(Color.parseColor("#0099CC00"));
_slice.setValue(100-batteryPct+0.00001f);
pieGraph.addSlice(slice);
pieGraph.addSlice(_slice);
pieGraph.setInnerCircleRatio(150);
for(PieSlice s : pieGraph.getSlices())
s.setGoalValue(s.getValue());
pieGraph.setDuration(1000);
pieGraph.setInterpolator(new AccelerateDecelerateInterpolator());
pieGraph.animateToGoalValues();
((TextView)rootView.findViewById(R.id.textView1)).setText(batteryPct+" %");
int health=intent.getIntExtra(BatteryManager.EXTRA_HEALTH,0);
int plugged=intent.getIntExtra(BatteryManager.EXTRA_PLUGGED,0);
String technology=intent.getExtras().getString(BatteryManager.EXTRA_TECHNOLOGY);
float temperature=intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE,0);
int voltage=intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE,0);
ArrayList<String> info=new ArrayList<String>(),value=new ArrayList<String>();
info.add(getString(R.string.ba_power_source));
value.add(plugged==0 ? getString(R.string.battery) : getString(R.string.charge));
info.add(getString(R.string.ba_type));
value.add(technology);
info.add(getString(R.string.temperature));
value.add((temperature/10)+" °C");
info.add(getString(R.string.voltage));
value.add(voltage+" mV");
info.add(getString(R.string.health));
value.add(getBatteryHealth(health));
initCard(info,value);
}
};
getActivity().registerReceiver(batteryInfo,new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
return rootView;
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:49,代码来源:BatteryManagement.java
示例5: DrawTask
import com.echo.holographlibrary.PieGraph; //导入依赖的package包/类
public DrawTask()
{
pg=(PieGraph)rootView.findViewById(R.id.graph);
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:5,代码来源:RAMManagement.java
注:本文中的com.echo.holographlibrary.PieGraph类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论